Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (149).NET Core  (24)Angular  (42)ASP.NET  (48)ASP.NET Core  (56)ASP.NET MVC  (84)Azure  (28)Blazor  (68)DocIO  (18)Essential JS 2  (67)Essential Studio  (161)Flutter  (76)JavaScript  (139)Microsoft  (101)PDF  (54)React  (30)Succinctly series  (120)Syncfusion  (457)TypeScript  (30)Uno Platform  (2)UWP  (4)Vue  (26)Webinar  (16)Windows Forms  (54)WPF  (105)Xamarin  (116)XlsIO  (22)Other CategoriesBarcode  (4)BI  (29)Bold BI  (3)Build conference  (6)Business intelligence  (53)Button  (4)C#  (104)Chart  (43)Cloud  (9)Company  (445)Dashboard  (6)Data Science  (3)Data Validation  (3)DataGrid  (36)Development  (244)Doc  (7)DockingManager  (1)eBook  (91)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (16)Extensions  (9)File Manager  (3)Gantt  (7)Gauge  (5)Git  (3)Grid  (25)HTML  (9)Installer  (2)Knockout  (2)LINQPad  (1)Linux  (1)M-Commerce  (1)Metro Studio  (11)Mobile  (176)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (18)Performance  (2)PHP  (1)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (5)Road Map  (9)Scheduler  (18)SfDataGrid  (8)Silverlight  (21)Sneak Peek  (14)Solution Services  (2)Spreadsheet  (3)SQL  (5)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (9)Tips and Tricks  (39)UI  (97)Uncategorized  (68)Unix  (2)User interface  (64)Visual State Manager  (1)Visual Studio  (15)Visual Studio Code  (8)Web  (150)What's new  (95)Windows 8  (19)Windows App  (1)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Share on twitter
Share on facebook
Share on linkedin
Introducing the Box and Whisker Chart in Flutter

Introducing the Box and Whisker Chart in Flutter

Our Syncfusion Flutter Charts widget provides 30+ of the most popular and widely used charts, like line, column, bar, pie, and doughnut. These charts include rich, interactive, customizable features that serve a world-wide audience with globalization and localization features.

To add to our collection, we have included the following two new chart types in our Flutter Charts widget in this 2020 Volume 3 release:

In this blog, I will walk you through how to create a box and whisker chart and the features available in it. The waterfall chart will be explained in another, separate blog. Besides these chart types, we have also implemented and included various new features in Flutter Charts. You can find details about those in this blog: What’s New in 2020 Vol 3: Flutter Charts.

Let’s explore the features of the new box and whisker chart!

Overview

The box and whisker chart is used to visualize a group of numerical data through their quartiles. It is also referred to as box plot chart. Box plots may also have lines extending vertically from the boxes (whiskers) indicating variability outside the upper and lower quartiles.

Box and whisker chart
Box and whisker chart

The box and whisker chart takes the following values as input.

ValueTypeDescription
XInt/ Double/ String/ DateTimeX-axis value of the data point.
YList of int or double valuesY-axis value of the data point.

Based on the data, the following values will be determined:

  • Minimum
  • Maximum
  • Median
  • Mean
  • Lower quartile
  • Upper quartile
  • Outliers

The following image shows the elements in a box and whisker chart.

Box and whisker chart elements
Box and whisker chart elements

To render a box and whisker chart, create an instance of the BoxAndWhiskerSeries and add it to the series collection property of SfCartesianChart.

Refer to the following code.

[Dart]
SfCartesianChart(
  series: <BoxAndWhiskerSeries<ChartData, String>>[
    BoxAndWhiskerSeries<ChartData, String>(
      dataSource: <ChartData>[
        ChartData('Development', [22, 22, 23, 25, 25, 25, 26, 27, 27]),
        ChartData('HR', [22, 24, 25, 30, 32, 34, 36, 38, 39, 41]),
        //...
      ],
      xValueMapper: (ChartData data, _) => data.x,
      yValueMapper: (ChartData data, _) => data.y
    ),
  ]
)

Box plot mode

The following are the three different modes of box plot rendering:

  • Exclusive: The quartile values are calculated using the formula (N+1) * P (N count, P percentile), and their index value starts from 1 in the list.
  • Inclusive: The quartile values are calculated using the formula (N−1) * P (N count, P percentile), and their index value starts from 0 in the list.
  • Normal: The quartile values are calculated by splitting the list and getting the median values.

The required box plot mode can be achieved by specifying the values to the boxPlotMode property. The default value is BoxPlotMode.normal.

Refer to the following code.

[Dart]
SfCartesianChart(
  series: <BoxAndWhiskerSeries<ChartData, String>>[
    BoxAndWhiskerSeries<ChartData, String>(
      dataSource: boxAndWhiskerData,
      xValueMapper: (ChartData data, _) => data.x,
      yValueMapper: (ChartData data, _) => data.y,
      boxPlotMode: BoxPlotMode.normal
    )
  ]
)
Box and whisker chart with various box plot modes
Box and whisker chart with various box plot modes

Mean value

A cross symbol is displayed in the box and whisker chart to indicate the mean value. It can be either displayed or hidden by specifying a value to the showMean property. The default value is true.

Refer to the following code.

[Dart]
SfCartesianChart(
  series: <BoxAndWhiskerSeries<ChartData, String>>[
    BoxAndWhiskerSeries<ChartData, String>(
      dataSource: boxAndWhiskerData,
      xValueMapper: (ChartData data, _) => data.x,
      yValueMapper: (ChartData data, _) => data.y,
      showMean: false
    )
  ]
)
Box and whisker chart without mean
Box and whisker chart without mean

Outliers

The outliers are shown above the maximum quartile. To customize the appearance of an outlier, you can use the properties in the MarkerSettings class.

Refer to the following code.

[Dart]
SfCartesianChart(
  series: <ChartSeries<ChartData, double>>[
    BoxAndWhiskerSeries<ChartData, double>(
      dataSource: boxAndWhiskerdata,
      xValueMapper: (ChartData data, _) => data.year,
      yValueMapper: (ChartData data, _) => data.number,
      markerSettings: MarkerSettings(
        shape: DataMarkerType.triangle
      )
    )
  ]
)
Box and whisker chart with customized outlier shape
Box and whisker chart with customized outlier shape

Width and spacing customization

Similar to the column chart, the width and spacing of the data points in the box and whisker chart can also be customized using the width and spacing properties in the series.

Refer to the following code.

[Dart]
SfCartesianChart(
  series: <BoxAndWhiskerSeries<ChartData, String>>[
    BoxAndWhiskerSeries<ChartData, String>(
      dataSource: boxAndWhiskerData,
      xValueMapper: (ChartData data, _) => data.x,
      yValueMapper: (ChartData data, _) => data.y,
      width: 0.5,
      spacing: 0.5
    )
  ]
)
Box and whisker chart with customized width and spacing
Box and whisker chart with customized width and spacing

Other supported features

As with other chart types, all major chart features are supported: data labels, animation, multiple series, side by side series placement, inversed axis, transposed axis, legend, tooltip, zooming and panning, etc.

Refer to the following  images.

Box and whisker chart with animation
Box and whisker chart with animation
Box and whisker chart with multiple series
Box and whisker chart with multiple series
Box and whisker chart with data labels
Box and whisker chart with data labels
Box and whisker chart with customized colors for each data point
Box and whisker chart with customized colors for each data point
Box and whisker chart with tooltip
Box and whisker chart with tooltip

Helpful links

For more details about the box and whisker chart type, you can refer to the following links:

Conclusion

I hope you now understand the box and whisker chart and its available functionalities in Syncfusion Flutter Charts. With this chart type, you can compare data sets from various categories. You can download this widget in our 2020 Volume 3 release.

If you aren’t a customer yet, you can try our 30-day free trial to check out these features.

Also, 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 forumfeedback portal, or Direct-Trac support system. We are always happy to assist you!

Tags:

Share this post:

Share on twitter
Share on facebook
Share on linkedin

Leave a comment

Popular Now

Be the first to get updates

Subscribe RSS feed
Scroll To Top