We are very excited to publish our first blog in a series called Design Tips. We are planning to publish blogs in this series every Thursday for three consecutive weeks. In this blog, we will walk you through some useful tips and tricks to improve the readability of charts. In the upcoming blogs in this series, we’ll provide tips to make your charts more understandable and aesthetically appealing.
Charts are one of the most important and widely used data visualization elements for representing data in graphical form.
While designing charts, many of us will make mistakes due to lack of awareness of chart design principles. This might lead to:
The following tips will help you improve the readability of your charts by eliminating common flaws in the design.
I have used the Syncfusion Flutter Charts widget for illustration. These tips are not limited to Flutter charts and are applicable to the charts in other platforms, as well.
Always include only the necessary elements in the design. Don’t add more content and make it clumsy. Most of the time, the border, background, and grids will not convey any details about the data to the user. So, we can remove these and keep the design simple.
[Dart] SfCartesianChart( borderWidth: 0, plotAreaBorderWidth: 0, primaryXAxis: NumericAxis( majorGridLines: MajorGridLines(width: 0) ), title: ChartTitle( text: 'Sales comparision of a product', borderWidth: 0 ) )
There may be cases in which you have large numbers in data, and you need to visualize them in a chart. Instead of displaying the numbers in their entirety, display them with units. (For example, display 1,000,000,000 as 1B.)
[Dart] import 'package:intl/intl.dart'; //... SfCartesianChart( primaryYAxis: NumericAxis( numberFormat: NumberFormat.compact() ), //... )
Axis scales convey the range of the data, starting, ending, and interval values, to the user. So, use proper interval values and change the label format based on your data. For example, if your data has values from various years, then displaying month and day values alone in the labels is not enough.
You can change the label format of the date-time axis using the dataFormat property in primaryXAxis. Refer to the following code example.
[Dart] SfCartesianChart( primaryXAxis: DateTimeAxis( dateFormat: DateFormat.yMd() ), //... )
For some real-time data, we deal with very precise decimal values. Displaying long decimal values in the chart will occupy too much space and degrade readability. So, in such cases, you should display the rounded-off values. For example, if your value is 17.8965432219, it should be displayed as 17.9.
For this, specify values to the decimalPlaces property in the primaryYAxis and the tooltip. Refer to the following code example.
[Dart] SfCartesianChart( primaryYAxis: NumericAxis( decimalPlaces: 1 ), tooltipBehavior: TooltipBehavior( enable: true, decimalPlaces: 1 ) //... )
In the design, there may be some information that is essential and must be displayed. But showing all of it together will look messy in the design. At that time, you might prefer showing the additional details on demand, i.e. using the tooltip feature in Flutter Charts. It will display the details of the data points in a pop-up when the user interacts with them.
[Dart] SfCartesianChart( tooltipBehavior: TooltipBehavior( enable: true ), //... )
Abbreviations are fine to in a chart. But it is even better to display the actual text. This will help users have a better understanding of the data. Also, if a user is not familiar with the abbreviation, then the information will not be completely conveyed to them.
[Dart] SfCartesianChart( series: <ChartSeries<ChartData, double>>[ ColumnSeries<ChartData, double>( name: 'Click-Through Rate', ), LineSeries<ChartData, double>( name: 'Cost Per Click' ) ], //... )
The axis labels’ text can overlap if there are a large number of labels, the labels are long, or the chart has a smaller width. In such cases, Flutter Charts will automatically hide the overlapping labels. If it’s a numeric or date-time axis, it is fine to hide the overlapping labels. But if it is a category axis and you hide the overlapping labels, then the user will not know the x value of that data point.
In that case, you can apply other overlap actions besides hide, like wrap, multiple rows, rotate 45, and rotate 90.
[Dart] SfCartesianChart( primaryXAxis: CategoryAxis( labelIntersectAction: AxisLabelIntersectAction.rotate45 ), //... )
We hope that these tips will help you in improving your Flutter Charts’ readability. Stay tuned for upcoming blogs in this series. Also check out our Charts component for different platforms in the following list:
If you wish to send us feedback or would like to submit any questions, please feel free to post them in the comments section of this blog post. You can also contact us through our support forum, feedback portal, or Direct-Trac support system.