charts_common 0.8.1

  • Readme
  • Changelog
  • Installing
  • 54

Common Charting library #

pub package

Common componnets for charting libraries.

Development #

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

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 #

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

Use this package as a library

1. Depend on it

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


dependencies:
  charts_common: ^0.8.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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_common/common.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
87
Health:
Code health derived from static analysis. [more]
3
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
54
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health suggestions

Fix lib/src/chart/line/line_renderer.dart. (-20.99 points)

Analysis of lib/src/chart/line/line_renderer.dart reported 47 hints, including:

line 36 col 26: Avoid const keyword.

line 40 col 5: Avoid const keyword.

line 72 col 12: Unnecessary new keyword.

line 74 col 27: Unnecessary new keyword.

line 82 col 22: Unnecessary new keyword.

Fix lib/src/common/material_palette.dart. (-17.76 points)

Analysis of lib/src/common/material_palette.dart reported 39 hints, including:

line 23 col 24: Avoid const keyword.

line 24 col 30: Avoid const keyword.

line 25 col 24: Avoid const keyword.

line 61 col 28: Avoid const keyword.

line 62 col 28: Avoid const keyword.

Fix lib/src/chart/scatter_plot/point_renderer.dart. (-15.67 points)

Analysis of lib/src/chart/scatter_plot/point_renderer.dart reported 34 hints, including:

line 41 col 5: Avoid const keyword.

line 44 col 5: Avoid const keyword.

line 47 col 5: Avoid const keyword.

line 52 col 5: Avoid const keyword.

line 56 col 33: Avoid const keyword.

Fix additional 96 files with analysis or formatting issues. (-280.52 points)

Additional issues in the following files:

  • lib/src/chart/common/behavior/range_annotation.dart (31 hints)
  • lib/src/chart/common/behavior/slider/slider.dart (27 hints)
  • lib/src/chart/pie/arc_renderer.dart (25 hints)
  • lib/src/chart/bar/bar_target_line_renderer.dart (20 hints)
  • lib/src/chart/bar/base_bar_renderer.dart (20 hints)
  • lib/src/chart/bar/bar_renderer.dart (18 hints)
  • lib/src/chart/common/behavior/line_point_highlighter.dart (18 hints)
  • lib/src/chart/cartesian/cartesian_chart.dart (16 hints)
  • lib/src/chart/cartesian/axis/time/date_time_tick_formatter.dart (15 hints)
  • lib/src/chart/layout/layout_manager_impl.dart (15 hints)
  • lib/src/chart/scatter_plot/comparison_points_decorator.dart (15 hints)
  • lib/src/chart/cartesian/axis/time/auto_adjusting_date_time_tick_provider.dart (14 hints)
  • lib/src/chart/cartesian/axis/axis.dart (13 hints)
  • lib/src/chart/common/selection_model/selection_model.dart (13 hints)
  • lib/src/chart/bar/bar_lane_renderer.dart (12 hints)
  • lib/src/chart/cartesian/axis/draw_strategy/gridline_draw_strategy.dart (11 hints)
  • lib/src/chart/cartesian/axis/simple_ordinal_scale.dart (11 hints)
  • lib/src/chart/cartesian/axis/spec/date_time_axis_spec.dart (11 hints)
  • lib/src/common/symbol_renderer.dart (11 hints)
  • lib/src/chart/common/behavior/selection/select_nearest.dart (10 hints)
  • lib/src/chart/cartesian/axis/draw_strategy/small_tick_draw_strategy.dart (9 hints)
  • lib/src/chart/cartesian/axis/numeric_tick_provider.dart (9 hints)
  • lib/src/chart/cartesian/axis/spec/ordinal_axis_spec.dart (9 hints)
  • lib/src/chart/common/behavior/chart_title/chart_title.dart (9 hints)
  • lib/src/chart/pie/arc_label_decorator.dart (9 hints)
  • lib/src/chart/layout/layout_margin_strategy.dart (8 hints)
  • lib/src/chart/cartesian/axis/linear/linear_scale.dart (7 hints)
  • lib/src/chart/cartesian/axis/spec/numeric_axis_spec.dart (7 hints)
  • lib/src/chart/pie/pie_chart.dart (7 hints)
  • lib/src/chart/scatter_plot/symbol_annotation_renderer.dart (7 hints)
  • lib/src/chart/common/behavior/a11y/domain_a11y_explore_behavior.dart (6 hints)
  • lib/src/chart/common/behavior/legend/legend.dart (6 hints)
  • lib/src/common/color.dart (6 hints)
  • lib/src/common/date_time_factory.dart (6 hints)
  • lib/src/chart/cartesian/axis/draw_strategy/base_tick_draw_strategy.dart (5 hints)
  • lib/src/chart/cartesian/axis/numeric_extents.dart (5 hints)
  • lib/src/chart/cartesian/axis/tick_formatter.dart (5 hints)
  • lib/src/chart/common/behavior/zoom/initial_hint_behavior.dart (5 hints)
  • lib/src/chart/bar/bar_label_decorator.dart (4 hints)
  • lib/src/chart/cartesian/axis/draw_strategy/none_draw_strategy.dart (4 hints)
  • lib/src/chart/cartesian/axis/spec/bucketing_axis_spec.dart (4 hints)
  • lib/src/chart/cartesian/axis/time/base_time_stepper.dart (4 hints)
  • lib/src/chart/cartesian/axis/time/date_time_scale.dart (4 hints)
  • lib/src/chart/cartesian/axis/time/day_time_stepper.dart (4 hints)
  • lib/src/chart/cartesian/axis/time/hour_time_stepper.dart (4 hints)
  • lib/src/chart/common/behavior/zoom/pan_behavior.dart (4 hints)
  • lib/src/chart/common/series_renderer.dart (4 hints)
  • lib/src/chart/layout/layout_config.dart (4 hints)
  • lib/src/chart/bar/base_bar_renderer_config.dart (3 hints)
  • lib/src/chart/cartesian/axis/ordinal_scale_domain_info.dart (3 hints)
  • lib/src/chart/cartesian/axis/time/date_time_axis.dart (3 hints)
  • lib/src/chart/cartesian/axis/time/minute_time_stepper.dart (3 hints)
  • lib/src/chart/common/behavior/calculation/percent_injector.dart (3 hints)
  • lib/src/chart/line/line_renderer_config.dart (3 hints)
  • lib/src/chart/pie/arc_renderer_config.dart (3 hints)
  • lib/src/chart/scatter_plot/symbol_annotation_renderer_config.dart (3 hints)
  • lib/src/chart/time_series/time_series_chart.dart (3 hints)
  • lib/src/chart/bar/bar_target_line_renderer_config.dart (2 hints)
  • lib/src/chart/bar/base_bar_renderer_element.dart (2 hints)
  • lib/src/chart/cartesian/axis/end_points_tick_provider.dart (2 hints)
  • lib/src/chart/cartesian/axis/linear/bucketing_numeric_tick_provider.dart (2 hints)
  • lib/src/chart/cartesian/axis/ordinal_extents.dart (2 hints)
  • lib/src/chart/cartesian/axis/spec/percent_axis_spec.dart (2 hints)
  • lib/src/chart/cartesian/axis/time/month_time_stepper.dart (2 hints)
  • lib/src/chart/cartesian/axis/time/year_time_stepper.dart (2 hints)
  • lib/src/chart/common/behavior/a11y/a11y_explore_behavior.dart (2 hints)
  • lib/src/chart/common/behavior/initial_selection.dart (2 hints)
  • lib/src/chart/common/behavior/legend/per_series_legend_entry_generator.dart (2 hints)
  • lib/src/chart/common/behavior/legend/series_legend.dart (2 hints)
  • lib/src/chart/common/behavior/selection/lock_selection.dart (2 hints)
  • lib/src/chart/common/canvas_shapes.dart (2 hints)
  • lib/src/chart/layout/layout_view.dart (2 hints)
  • lib/src/chart/scatter_plot/point_renderer_config.dart (2 hints)
  • lib/src/chart/scatter_plot/scatter_plot_chart.dart (2 hints)
  • lib/src/chart/treemap/treemap_label_decorator.dart (2 hints)
  • lib/src/common/palette.dart (2 hints)
  • lib/src/data/series.dart (2 hints)
  • lib/src/chart/bar/bar_chart.dart (1 hint)
  • lib/src/chart/bar/bar_lane_renderer_config.dart (1 hint)
  • lib/src/chart/bar/bar_renderer_config.dart (1 hint)
  • lib/src/chart/cartesian/axis/linear/bucketing_numeric_axis.dart (1 hint)
  • lib/src/chart/cartesian/axis/linear/linear_scale_domain_info.dart (1 hint)
  • lib/src/chart/cartesian/axis/linear/linear_scale_viewport.dart (1 hint)
  • lib/src/chart/cartesian/axis/spec/axis_spec.dart (1 hint)
  • lib/src/chart/cartesian/axis/static_tick_provider.dart (1 hint)
  • lib/src/chart/cartesian/axis/tick_provider.dart (1 hint)
  • lib/src/chart/common/behavior/domain_highlighter.dart (1 hint)
  • lib/src/chart/common/behavior/legend/datum_legend.dart (1 hint)
  • lib/src/chart/common/behavior/legend/per_datum_legend_entry_generator.dart (1 hint)
  • lib/src/chart/common/behavior/zoom/panning_tick_provider.dart (1 hint)
  • lib/src/chart/common/chart_canvas.dart (1 hint)
  • lib/src/chart/common/datum_details.dart (1 hint)
  • lib/src/chart/common/processed_series.dart (1 hint)
  • lib/src/chart/line/line_chart.dart (1 hint)
  • lib/src/common/proxy_gesture_listener.dart (1 hint)
  • lib/src/common/style/style_factory.dart (1 hint)

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. (-20 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.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and charts_common.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
collection ^1.14.5 1.14.12
intl >=0.15.2 <0.17.0 0.16.0
logging any 0.11.3+2
meta ^1.1.1 1.1.8
vector_math ^2.0.8 2.0.8
Transitive dependencies
path 1.6.4
Dev dependencies
mockito ^4.0.0
test ^1.5.3