charts_flutter_samf 0.9.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

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_samf in the GitHub repo contains a full Flutter app with many demo examples.

Development #

This project is developed internally at Google and published for external consumption, external contributions unfortunately cannot be taken at this time.

0.9.0 #

  • Internal bug fixes
  • Bump versions in Gemlock file due to security alerts

0.8.1 #

  • Update intl version.

0.8.0 #

  • Bug fixes from open source.

0.7.0 #

  • Added vertical bar label

0.6.0 #

  • Bars can now be rendered on line charts.
  • Negative measure values will now be rendered on bar charts as a separate stack from the positive values.
  • Added a Datum Legend, which displays one entry per value in the first series on the chart. This is useful for pie and scatter plot charts.
  • The AxisPosition enum in RTLSpec was refactored to AxisDirection to better reflect its effect on swapping the positions of all start and end components, and not just positioning the measure axes.
  • Added custom colors for line renderer area skirts and confidence intervals. A new "areaColorFn" has been added to Series, and corresponding data to the datum. We could not use the fillColorFn for these elements, because that color is already applied to the internal section of points on line charts (including highlighter behaviors).

0.5.0 #

  • 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.

0.4.0 #

  • 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_samf 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
  • BarTargetLineRendererConfig is no longer default of type String, please change current usage to BarTargetLineRendererConfig

0.3.0 #

  • 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
  • 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

0.2.0 #

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

0.1.0 #

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_samf: ^0.9.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub 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_samf/flutter.dart';
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 Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart


  • charts_flutter_samf that is a package requiring null.

Health suggestions

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

Analysis of lib/flutter.dart reported 1 hint:

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

Fix lib/src/behaviors/a11y/domain_a11y_explore_behavior.dart. (-0.50 points)

Analysis of lib/src/behaviors/a11y/domain_a11y_explore_behavior.dart reported 1 hint:

line 96 col 41: Avoid using braces in interpolation when not needed.

Fix lib/src/behaviors/legend/legend_entry_layout.dart. (-0.50 points)

Analysis of lib/src/behaviors/legend/legend_entry_layout.dart reported 1 hint:

line 133 col 45: 'body1' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is bodyText2. This feature was deprecated after v1.13.8..

Fix lib/src/behaviors/slider/slider.dart. (-0.50 points)

Analysis of lib/src/behaviors/slider/slider.dart reported 1 hint:

line 156 col 62: Avoid using braces in interpolation when not needed.

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 package description is too short. (-15 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <3.0.0
charts_common 0.9.0 0.9.0
collection ^1.14.5 1.14.12 1.14.13
flutter 0.0.0
intl >=0.15.2 <0.17.0 0.16.1
logging any 0.11.4
meta ^1.1.1 1.1.8 1.2.2
Transitive dependencies
path 1.7.0
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
mockito any
test ^1.3.0