Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (143).NET Core  (23)Angular  (39)ASP.NET  (47)ASP.NET Core  (53)ASP.NET MVC  (83)Azure  (26)Blazor  (47)DocIO  (18)Essential JS 2  (64)Essential Studio  (159)Flutter  (52)JavaScript  (134)Microsoft  (96)PDF  (48)React  (29)Succinctly series  (118)Syncfusion  (399)TypeScript  (30)Uno Platform  (2)UWP  (4)Vue  (25)Webinar  (14)Windows Forms  (52)WPF  (92)Xamarin  (105)XlsIO  (20)Other CategoriesBarcode  (4)BI  (29)Bold BI  (3)Build conference  (6)Business intelligence  (53)Button  (4)C#  (99)Chart  (40)Cloud  (8)Company  (445)Dashboard  (4)Data Science  (3)Data Validation  (2)DataGrid  (31)Development  (233)Doc  (7)eBook  (89)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (13)Extensions  (7)File Manager  (3)Gantt  (6)Gauge  (4)Git  (3)Grid  (24)HTML  (8)Installer  (1)Knockout  (2)LINQPad  (1)Linux  (1)M-Commerce  (1)Metro Studio  (11)Mobile  (139)Mobile MVC  (9)OLAP server  (1)Orubase  (12)Partners  (20)PDF viewer  (15)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  (15)SfDataGrid  (7)Silverlight  (21)Sneak Peek  (12)Solution Services  (2)Spreadsheet  (2)SQL  (4)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (9)Tips and Tricks  (15)UI  (62)Uncategorized  (68)Unix  (2)User interface  (48)Visual State Manager  (1)Visual Studio  (12)Visual Studio Code  (7)Web  (96)What's new  (61)Windows 8  (19)Windows App  (1)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Share on twitter
Share on facebook
Share on linkedin
What’s New in 2020 Volume 3: Flutter Charts

What’s New in 2020 Volume 3: Flutter Charts

At Syncfusion, we are continuously reviewing the constructive questions and comments we receive from our customers, which include various feature requests. From these, we handpicked the most widely requested features and made them available in the Essential Studio 2020 Volume 3 release.

In this blog post, I’ll quickly review the new chart types and features included in the Flutter Charts widget for the 2020 Volume 3 release.

Let’s see them!

New chart types

We extended the Syncfusion Flutter Charts widget to support two more chart types:

Box and whisker chart

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

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]),
        //...
      ],
      showMean: true,
      xValueMapper: (ChartData data, _) => data.x,
      yValueMapper: (ChartData data, _) => data.y
    ),
  ]
)  

After executing this code example, we will get output like in the following screenshot.

Box and whisker chart
Box and whisker chart

UG link: https://help.syncfusion.com/flutter/cartesian-charts/chart-types#box-and-whisker-chart

SB sample link: https://flutter.syncfusion.com/#/cartesian-charts/chart-types/box-and-whisker/box-and-whisker-chart

Waterfall chart

The waterfall chart shows gradual changes in the quantitative value of an entity that is subjected to changes by increments or decrements. Using the waterfall chart, you can quickly illustrate changes in revenue.

Refer to the following code.

 
[Dart]
SfCartesianChart(
  series: <ChartSeries<ChartData, double>>[
    WaterfallSeries<ChartData, double>(
      dataSource: <ChartData>[
        ChartData(2, 10),
        ChartData(3, -3),
        ChartData(4, 5, true),
        //...
        ChartData(13, -5, false, true),
      ],
      xValueMapper: (ChartData data, _) => data.x,
      yValueMapper: (ChartData data, _) => data.y,
      intermediateSumPredicate: (ChartData data, _) => data.isIntermediate,
      totalSumPredicate: (ChartData data, _) => data.isTotal,
      negativePointsColor: const Color.fromRGBO(229, 101, 144, 1),
      intermediateSumColor: const Color.fromRGBO(79, 129, 188, 1),
      totalSumColor: const Color.fromRGBO(79, 129, 188, 1),
      connectorLineSettings: WaterfallConnectorLineSettings(
        width: 2.5,
        dashArray: <double>[3, 1]
      )
    )
  ]
)

After executing this code example, we will get output like in the following screenshot.

Waterfall chart
Waterfall chart

UG link: https://help.syncfusion.com/flutter/cartesian-charts/chart-types#waterfall-chart

SB sample link: https://flutter.syncfusion.com/#/cartesian-charts/chart-types/waterfall/default-waterfall-chart

Feature enhancements

Exporting

A rendered chart can be exported and saved locally as a PNG image or PDF document for future use. The following code snippet shows exporting a chart as a PNG image.

 
[Dart]
dart_ui.Image data = await _cartesianKey.currentState.toImage(pixelRatio: 3.0);
final bytes = await data.toByteData(format: dart_ui.ImageByteFormat.png);
if (data != null) {
  await Navigator.of(context).push(
    MaterialPageRoute(
      builder: (BuildContext context) {
        return Scaffold(
          body: Center(
            child: Container(
              color: Colors.white,
              child: Image.memory(bytes.buffer.asUint8List()),
            )
          )
        );
      }
    )
  );
}

UG link – https://help.syncfusion.com/flutter/cartesian-charts/export-cartesian-chart

Trackball features

The trackball has the following new feature enhancements in this release.

Marker for trackball

The newly introduced trackball marker feature helps you indicate an exact data point location. You can also add a shape to adorn each data point when the trackball is visible. The trackball marker can be shown or hidden independently and also displayed based on the series marker’s visibility.

Refer to the following code.

 
[Dart]
SfCartesianChart(
  trackballBehavior: TrackballBehavior(
    enable: true,
    markerSettings: TrackballMarkerSettings(
      markerVisibility: TrackballVisibilityMode.visible
    )
  )
)
Trackball marker
Trackball marker

Trackball tooltip overlap

From this Volume 3 release onwards, if there are two or more series data points rendered close to each other, then the trackball tooltips of each data point will not overlap with each other. They will be repositioned automatically. No API is required to enable this feature.

Refer to the following screenshot.
Trackball tooltip overlap

UG link: https://help.syncfusion.com/flutter/cartesian-charts/trackball-crosshair#trackball

SB sample link: https://flutter.syncfusion.com/#/cartesian-charts/user-interactions/trackball/chart-with-trackball

Data label features

The data label feature has the following new enhancements in this release.

Padding for data labels

You can add padding to a data label to move it both vertically and horizontally from its initial position. Logical pixel value is provided as input.

Refer to the following code.

 
[Dart]
SfCartesianChart(
  series: <CartesianSeries<ChartData,num>>[
    SplineSeries<ChartData, num>(
      dataLabelSettings: DataLabelSettings(
        isVisible: true,
        offset: Offset(0, 30)
      )
    )
  ]
)

Refer to the following screenshot.

Padding for data labels

Data label tap callback

This is a callback event. It will be triggered when you tap on a data label of a data point in the series.

Refer to the following code.

 
[Dart]
SfCartesianChart(
  onDatalabelTapped: (DataLabelTapArgs args) {
    print(args.seriesIndex);                 
  },
  series: <ChartSeries<ChartData, DateTime>>[
    LineSeries<ChartData, DateTime>(
      dataLabelSettings: DataLabelSettings(
        isVisible: true
      )
    )
  ]
)

UG link: https://help.syncfusion.com/flutter/cartesian-charts/marker-datalabel#data-label

SB sample link: https://flutter.syncfusion.com/#/cartesian-charts/series-features/data-label/default-data-labels

Animate the series dynamically

You can perform initial rendering animation in an existing series by using this feature. On calling the animate method, a particular series will be animated based on the animationDuration property’s value in the series.

Refer to the following code.

 
[Dart]
Widget build(BuildContext context) {
    ChartSeriesController _chartSeriesController;
      return Column(
        children: <Widget>[
          Container(
            child: SfCartesianChart(
              series: <ChartSeries<ChartData, String>>[
                ColumnSeries<ChartData, String>(
                  animationDuration: 2000,
                  onRendererCreated: (ChartSeriesController controller) {
                    _chartSeriesController = controller;
                  }
                )
              ],
            )
          ),
          Container(
            child: RaisedButton(
                onPressed: () {
                  _chartSeriesController?.animate();
                },
                child: Text('Animate'),
            )
          ),
      );
    }

Animate the series dynamicallySB sample link : https://flutter.syncfusion.com/#/cartesian-charts/series-features/animation/series-animation

Select the data points dynamically

The data points in a chart can be selected programmatically by passing the point index and series index values to the selectDataPoints method.

Refer to the following code.

 
[Dart]
SfCartesianChart chart;
SelectionBehavior selection;

@override
Widget build(BuildContext context) {    
  selection = SelectionBehavior(enable: true);  
  chart = SfCartesianChart(
    series: <CartesianSeries>[
      ColumnSeries<ChartData, double>(
        selectionBehavior: selection
      )
    ]
  );
    
  return Scaffold(
    body: Column(
      children: <Widget>[
        FlatButton(
          child: Text('Select'),
            onPressed: select
          ),
        Container(child: chart)
      ]
    )
  );
}

void select() {
  selection.selectDataPoints(1, 0);
}

Select the data points dynamicallySB sample link: https://flutter.syncfusion.com/#/cartesian-charts/user-interactions/selection/dynamic-selection

Anchor range to data points

This new feature is used to determine the value of the axis range, based on the visible data points or based on the overall data points available in the chart. The visible data points can be changed on performing interactions like pinch zooming, selection zooming, and panning, and also on specifying visibleMinimum and visibleMaximum values.

Refer to the following code.

 
[Dart]
SfCartesianChart(
  primaryYAxis: NumericAxis(
    anchorRangeToVisiblePoints: true
  )
)

Anchor range to data pointsSB sample link: https://flutter.syncfusion.com/#/cartesian-charts/user-interactions/zooming-and-panning/pinch-zooming

Breaking changes

The selectionSettings property and the SelectionSettings class have been deprecated. Now, you can use the selectionBehavior property and SelectionBehavior class, respectively, instead of them.

Refer to the following code.

 
[Dart]
SfCartesianChart(
  series: <CartesianSeries<ChartData, double>>[
    ColumnSeries<ChartData, double>(
      selectionBehavior: SelectionBehavior(
        // Enables selection
        enable: true
      )
    )
  ]
);

Conclusion

I hope you now have a clear idea of the various new features and enhancements available for the Syncfusion Flutter Charts widget in the 2020 Volume 3 release. For more details about the bug fixes and other enhancements, check out our release notes.

Browse our documentation to learn more about our Syncfusion Flutter widgets. You can also see Syncfusion’s Flutter app with many examples in this GitHub repo. Don’t miss our demo app in Google Play and the App Store.

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