Line Charts in the Wild
How to Tame Them in Power BI
We frequently encounter the necessity to illustrate timelines, analyzing shifts in a metric over time. In such instances, a variety of tasks may present themselves:
- Monitoring seasonal/monthly trends
- Conducting historical evaluations of processes
- Identifying causation and effects
- Comparing indicators with previous periods, and much more.
All of these tasks are exceptionally intriguing and can offer valuable insights for the business. They aid in discovering points of profit growth, understanding detrimental and advantageous triggers, studying audience behavior, and identifying market niches.
Even in an individual’s personal life, there are occasions when it becomes essential to comprehend the trajectory of one’s life — whether their income is increasing over the years, if their weight is on the rise, or how factors like sugar levels and blood pressure are evolving. Additionally, questions may arise about their engagement in sports compared to previous years.
Navigating through a myriad of data points over the years, which may fluctuate, decline, and then rebound, can be a daunting task. Understanding the overarching trend is crucial.
This is precisely why data visualization comes into play — to offer a clearer perspective on the data. For the analysis of dynamic processes, charts such as:
- Line chart
- Area chart, stacked area chart
- Combined chart: line + stacked column, line + clustered column
- Ribbon chart
Furthermore, a column chart may become part of this ‘family’ when a date is added to the X-axis, but we won’t delve into that here. In this article, we will closely examine the aforementioned charts and learn how to configure them effectively in a software package like Power BI. However, the principles will be similar in other software packages.
Common aspects
Date hierarchy: How to navigate
However, we cannot proceed to explore visually appealing charts until we delve into the equally fascinating realm of data. Data for timelines possesses distinct characteristics and is typically stored in various formats.
DATE TIME DATE/TIME
Data in these formats may be stored solely by years, resembling INTEGER (an integer data type). Yet, more often, the scenario is more intricate because years encompass months, months encompass days, and days break down into hours, minutes, and seconds!… Analysis is frequently required at all these different levels. For instance, we may need to compare profit indicators from year to year, evaluate electricity grid loads by seasons and months, monitor changes in traffic throughout the week, and assess the frequency of watching various TV shows throughout the day. The complexity of scenarios like these is boundless.
And for all these types of analyses, we require the same detailed data, complete with intricate data labels spanning from years to seconds — encompassing both DATE and TIME.
Subsequently, we have the option to determine at which level each chart will present the data. Unfortunately, displaying every detail simultaneously is impractical, making it challenging to discern all the levels. Consequently, more frequently, a distinct chart is employed for each specific task.
In Power BI, users have the capability to adjust the level of detail in the charts through the chart settings, although this isn’t the most prevalent solution.
There are icons with arrows above the chart to assist you in this process. In the illustration, the “splitting” arrow “Expand all down one level in the hierarchy” is highlighted. It accurately guides us to the quarter, month, or day.
By progressively expanding the hierarchy, we obtain sales charts categorized by quarters, by month, and by day. If there is a need to revert to the previous level, simply click on the “Drill up” arrow.
Now, let’s delve into the features and settings of charts utilized for dynamic data visualization! We will explore a series of issues and scenarios you may encounter, along with their resolutions.
Poor readability of X-axis labels
Problem:
In your chart, ellipses may appear on the X-axis, and labels might rotate vertically or diagonally, posing difficulties for users during later reading. This is often caused by an excess of data points, causing the entire X-axis with detailed information to become overcrowded.
Solution:
To address this, consider shortening the month labels or adjusting the data granularity. For instance, you can remove the “Day” field from the date hierarchy. This helps in enhancing the overall readability of the chart.
The other method is to set up custom short month names — this will be much more informative and won’t have distracting ellipses.
Y-axis does not start from 0. When to use and when not to use
Problem:
In Power BI, the default setting for a line graph has the y-axis starting at the smallest value in the data, potentially conveying a misleading impression of abrupt changes (e.g., a drop in sales from February to March). While such a representation might be acceptable for a line chart, as it is more focused on assessing the rate of changes than their magnitude, it becomes critical in the case of an area chart. This is due to the shaded area being directly associated with the variable’s magnitude and cannot be truncated, as seen in bar charts, for instance.
Solution:
To address this, consider adjusting the Y-axis to start at 0. This alteration transforms the visualization, making the sales decline appear less drastic. It provides a more accurate representation of stable sales throughout the year with a slight dip in February and a peak in August.
Guideline:
For area charts, it is advisable always to display 0 on the Y-axis to maintain the integrity of the shaded area and accurately reflect the variable’s magnitude.
Messy appearance of data labels
Problem:
When data labels are activated, they might not fit appropriately and could overlap, creating a cluttered appearance on the chart.
Solution:
To rectify this, consider adjusting the data label density and enabling automatic placement, either above or below the data points. Additionally, you can abbreviate values to thousands or millions and eliminate redundant decimal places, displaying fewer digits in the values.
Note:
It’s essential to be mindful that rules for different data series may vary. Further information on this can be found below.
Filling the area below the chart with color, when does it make sense?
Problem:
Your chart might appear “empty” or “boring,” especially when there are few data points.
Solution:
Consider changing the visualization type to an area chart. Keep in mind that area charts are typically constructed from 0 along the Y-axis. While this is more of a recommendation than a strict rule, adhering to it generally enhances the visual appeal of the chart.
How to format multiple categories?
How to distinguish between data series?
Problem:
Labels for two datasets may overlap, creating challenges in reading the data.
Solution:
An uncomplicated remedy involves adjusting the formatting of data labels to distinctly correspond to their respective series. For instance, match the color of the labels with their corresponding charts.
In cases where charts are densely populated, adding a second vertical axis may be considered, although this is not the optimal solution (ensure that all Y-axes start from 0).
In such instances, labels can be omitted, and the axes can be colored differently to align with each dataset.
Combined line and column chart
Problem:
When dealing with multiple categories that need to be represented on a single chart, using a line for all indicators can result in a confusing visual representation. Additionally, if the data varies significantly in magnitude, certain indicators may get overshadowed by others.
Solution:
To address this, consider using a combined chart. This approach ensures clarity for the user, as each indicator has its distinct visual representation and corresponding data labels (matching data labels by color to the dataset remains important). Essentially, this involves incorporating a second axis, which can make data interpretation more intricate but is sometimes unavoidable. However, it’s worth exploring the alternative of displaying data on separate charts stacked on top of each other to maintain synchronized X-axes.
Ribbon chart: Should you use it?
This chart possesses a certain charm, yet its application is somewhat limited, and its functionality is constrained. Data labels in this chart can quickly become indistinct and unreadable, particularly at smaller values. It primarily illustrates proportions between categories and alterations in their rankings, constituting what I would consider advanced visualization due to its need for careful application.
Problem:
The challenge lies in the improper use of the chart. The ribbon chart essentially depicts the fluctuation in category rankings at each data point, a task that arises relatively infrequently.
Solution:
If your data is not effectively conveyed on this type of chart, especially when dealing with numerous streams resulting in overly colorful and uninformative ribbons, consider switching to a stacked bar chart. This adjustment enhances the visibility of data labels. Additionally, reassess the color scheme. If you are primarily concerned with one specific category, it may be more beneficial to highlight only that particular category for clarity.
SUMMARY
Here’s a concise recap! I trust that I’ve provided you with valuable insights and considerations regarding the portrayal of dynamic processes through charts.
This represents one of the most prevalent objectives in data visualization, and I’m confident that you have encountered or will encounter similar tasks. Remember to adhere to fundamental principles!
Checklist:
- Customize the X-axis.
- Adjust the Y-axis scale.
- Incorporate data labels.
- Exercise caution when using the secondary Y-axis, particularly when comparing values of different ranges.
- Limit the display of series in any chart of this type (line, area, stacked area, ribbon) to no more than 5.
That’s it! Enjoy your visualization journey!
May your trends always be positive!
If you want to read more about different types of charts, their features, and settings, I recommend the following articles on this topic:
- To navigate through different types of charts: Why chart-choosers don’t help, and what is a dataviz compass?
- Trends in chart design that should not be repeated: Dashboard Anti-Trends. Design Tips for Business Analysts
- The Evolution of the Gantt Chart. Visualization to help with project management
- Improving the appearance of dashboards and charts with a specific example: Your dashboard is a bit crooked?. The repair team is here to help!