charts_flutter 0.5.0

  • Example
  • Installing
  • Versions
  • 91

Flutter Charting library

pub package

Material Design data visualization library written natively in Dart.

Supported charts

See the online gallery.

Using the library

The /example/ folder inside charts_flutter in the GitHub repo contains a full Flutter app with many demo examples.


  • SelectionModelConfig's listener parameter has been renamed to "changeListener". This is a breaking change. Please rename any existing uses of the "listener" parameter to "changeListener". This was named in order to add an additional listener "updateListener" that listens to any update requests, regardless if the selection model has changed.
  • CartesianChart's method getMeasureAxis(String axisId) has been changed to getMeasureAxis({String axisId) so that getting the primary measure axis will not need passing any id that does not match the secondary measure axis id. This affects users implementing custom behaviors using the existing method.


  • Fixed export file to export ChartsBehavior in the Flutter library instead of the one that resides in charts_common. The charts_common behavior should not be used except internally in the charts_flutter library. This is a breaking change if you are using charts_common behavior.
  • Declare compatibility with Dart 2.
  • BasicNumericTickFormatterSpec now takes in a callback instead of NumberFormat as the default constructor. Use named constructor withNumberFormat instead. This is a breaking change.
  • BarRendererConfig is no longer default of type String, please change current usage to BarRendererConfig<String>. This is a breaking change.
  • BarTargetLineRendererConfig is no longer default of type String, please change current usage to BarTargetLineRendererConfig<String>. This is a breaking change.


  • Simplified API by removing the requirement for specifying the datum type when creating a chart. For example, previously to construct a bar chart the syntax was 'new BarChart<MyDatumType>()'. The syntax is now cleaned up to be 'new BarChart()'. Please refer to the online gallery for the correct syntax.
  • Added scatter plot charts
  • Added tap to hide for legends
  • Added support for rendering area skirts to line charts
  • Added support for configurable fill colors to bar charts


  • Update color palette. Please use MaterialPalette instead of QuantumPalette.
  • Dart2 fixes


Initial release.


// Copyright 2018 the Charts project authors. Please see the AUTHORS file
// for details.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:flutter/material.dart';
import 'app_config.dart';
import 'home.dart';

/// The main gallery app widget.
class GalleryApp extends StatefulWidget {
  GalleryApp({Key key}) : super(key: key);

  GalleryAppState createState() => new GalleryAppState();

/// The main gallery app state.
/// Controls performance overlay, and instantiates a [Home] widget.
class GalleryAppState extends State<GalleryApp> {
  // Initialize app settings from the default configuration.
  bool _showPerformanceOverlay = defaultConfig.showPerformanceOverlay;

  Widget build(BuildContext context) {
    return new MaterialApp(
        title: defaultConfig.appName,
        theme: defaultConfig.theme,
        showPerformanceOverlay: _showPerformanceOverlay,
        home: new Home(
          showPerformanceOverlay: _showPerformanceOverlay,
          onShowPerformanceOverlayChanged: (bool value) {
            setState(() {
              _showPerformanceOverlay = value;

void main() {
  runApp(new GalleryApp());

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  charts_flutter: ^0.5.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:charts_flutter/flutter.dart';
Version Uploaded Documentation Archive
0.5.0 Oct 31, 2018 Go to the documentation of charts_flutter 0.5.0 Download charts_flutter 0.5.0 archive
0.4.0 Aug 6, 2018 Go to the documentation of charts_flutter 0.4.0 Download charts_flutter 0.4.0 archive
0.3.0 May 10, 2018 Go to the documentation of charts_flutter 0.3.0 Download charts_flutter 0.3.0 archive
0.2.0 Apr 16, 2018 Go to the documentation of charts_flutter 0.2.0 Download charts_flutter 0.2.0 archive
0.0.1+1 Mar 23, 2018 Go to the documentation of charts_flutter 0.0.1+1 Download charts_flutter 0.0.1+1 archive
0.0.1 Mar 23, 2018 Go to the documentation of charts_flutter 0.0.1 Download charts_flutter 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/flutter.dart. (-0.50 points)

Analysis of lib/flutter.dart reported 1 hint:

line 121 col 9: The library 'package:charts_common/common.dart' doesn't export a member with the shown name 'QuantumPalette'.

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: logging.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <3.0.0
charts_common 0.5.0 0.5.0
collection ^1.14.5 1.14.11
flutter 0.0.0
intl ^0.15.2 0.15.7
logging any 0.11.3+2
meta ^1.1.1 1.1.6
Transitive dependencies
path 1.6.2
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
mockito any
test ^1.3.0