├── .github └── workflows │ └── ci.yml ├── .gitignore ├── AUTHORS ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── charts_common ├── CHANGELOG.md ├── LICENSE ├── README.md ├── charts_common.gwsq ├── lib │ ├── common.dart │ └── src │ │ ├── chart │ │ ├── bar │ │ │ ├── bar_chart.dart │ │ │ ├── bar_error_decorator.dart │ │ │ ├── bar_label_decorator.dart │ │ │ ├── bar_lane_renderer.dart │ │ │ ├── bar_lane_renderer_config.dart │ │ │ ├── bar_renderer.dart │ │ │ ├── bar_renderer_config.dart │ │ │ ├── bar_renderer_decorator.dart │ │ │ ├── bar_target_line_renderer.dart │ │ │ ├── bar_target_line_renderer_config.dart │ │ │ ├── base_bar_renderer.dart │ │ │ ├── base_bar_renderer_config.dart │ │ │ └── base_bar_renderer_element.dart │ │ ├── cartesian │ │ │ ├── axis │ │ │ │ ├── auto_adjusting_static_tick_provider.dart │ │ │ │ ├── axis.dart │ │ │ │ ├── axis_tick.dart │ │ │ │ ├── collision_report.dart │ │ │ │ ├── draw_strategy │ │ │ │ │ ├── base_tick_draw_strategy.dart │ │ │ │ │ ├── gridline_draw_strategy.dart │ │ │ │ │ ├── none_draw_strategy.dart │ │ │ │ │ ├── range_tick_draw_strategy.dart │ │ │ │ │ ├── small_tick_draw_strategy.dart │ │ │ │ │ └── tick_draw_strategy.dart │ │ │ │ ├── end_points_tick_provider.dart │ │ │ │ ├── linear │ │ │ │ │ ├── bucketing_numeric_axis.dart │ │ │ │ │ ├── bucketing_numeric_tick_provider.dart │ │ │ │ │ ├── linear_scale.dart │ │ │ │ │ ├── linear_scale_domain_info.dart │ │ │ │ │ ├── linear_scale_function.dart │ │ │ │ │ └── linear_scale_viewport.dart │ │ │ │ ├── numeric_extents.dart │ │ │ │ ├── numeric_scale.dart │ │ │ │ ├── numeric_tick_provider.dart │ │ │ │ ├── ordinal_extents.dart │ │ │ │ ├── ordinal_scale.dart │ │ │ │ ├── ordinal_scale_domain_info.dart │ │ │ │ ├── ordinal_tick_provider.dart │ │ │ │ ├── range_axis_tick.dart │ │ │ │ ├── range_tick.dart │ │ │ │ ├── range_tick_provider.dart │ │ │ │ ├── scale.dart │ │ │ │ ├── simple_ordinal_scale.dart │ │ │ │ ├── spec │ │ │ │ │ ├── axis_spec.dart │ │ │ │ │ ├── bucketing_axis_spec.dart │ │ │ │ │ ├── date_time_axis_spec.dart │ │ │ │ │ ├── end_points_time_axis_spec.dart │ │ │ │ │ ├── numeric_axis_spec.dart │ │ │ │ │ ├── ordinal_axis_spec.dart │ │ │ │ │ ├── percent_axis_spec.dart │ │ │ │ │ ├── range_tick_spec.dart │ │ │ │ │ └── tick_spec.dart │ │ │ │ ├── static_tick_provider.dart │ │ │ │ ├── tick.dart │ │ │ │ ├── tick_formatter.dart │ │ │ │ ├── tick_provider.dart │ │ │ │ └── time │ │ │ │ │ ├── auto_adjusting_date_time_tick_provider.dart │ │ │ │ │ ├── base_time_stepper.dart │ │ │ │ │ ├── date_time_axis.dart │ │ │ │ │ ├── date_time_extents.dart │ │ │ │ │ ├── date_time_scale.dart │ │ │ │ │ ├── date_time_tick_formatter.dart │ │ │ │ │ ├── day_time_stepper.dart │ │ │ │ │ ├── hour_tick_formatter.dart │ │ │ │ │ ├── hour_time_stepper.dart │ │ │ │ │ ├── minute_time_stepper.dart │ │ │ │ │ ├── month_time_stepper.dart │ │ │ │ │ ├── simple_time_tick_formatter.dart │ │ │ │ │ ├── time_range_tick_provider.dart │ │ │ │ │ ├── time_range_tick_provider_impl.dart │ │ │ │ │ ├── time_stepper.dart │ │ │ │ │ ├── time_tick_formatter.dart │ │ │ │ │ ├── time_tick_formatter_impl.dart │ │ │ │ │ └── year_time_stepper.dart │ │ │ ├── cartesian_chart.dart │ │ │ └── cartesian_renderer.dart │ │ ├── common │ │ │ ├── base_chart.dart │ │ │ ├── behavior │ │ │ │ ├── a11y │ │ │ │ │ ├── a11y_explore_behavior.dart │ │ │ │ │ ├── a11y_node.dart │ │ │ │ │ ├── domain_a11y_explore_behavior.dart │ │ │ │ │ └── keyboard_domain_navigator.dart │ │ │ │ ├── calculation │ │ │ │ │ └── percent_injector.dart │ │ │ │ ├── chart_behavior.dart │ │ │ │ ├── chart_title │ │ │ │ │ └── chart_title.dart │ │ │ │ ├── domain_highlighter.dart │ │ │ │ ├── domain_outliner.dart │ │ │ │ ├── initial_selection.dart │ │ │ │ ├── legend │ │ │ │ │ ├── datum_legend.dart │ │ │ │ │ ├── legend.dart │ │ │ │ │ ├── legend_entry.dart │ │ │ │ │ ├── legend_entry_generator.dart │ │ │ │ │ ├── per_datum_legend_entry_generator.dart │ │ │ │ │ ├── per_series_legend_entry_generator.dart │ │ │ │ │ └── series_legend.dart │ │ │ │ ├── line_point_highlighter.dart │ │ │ │ ├── range_annotation.dart │ │ │ │ ├── selection │ │ │ │ │ ├── lock_selection.dart │ │ │ │ │ ├── select_nearest.dart │ │ │ │ │ └── selection_trigger.dart │ │ │ │ ├── slider │ │ │ │ │ └── slider.dart │ │ │ │ ├── sliding_viewport.dart │ │ │ │ ├── sunburst_ring_expander.dart │ │ │ │ └── zoom │ │ │ │ │ ├── initial_hint_behavior.dart │ │ │ │ │ ├── pan_and_zoom_behavior.dart │ │ │ │ │ ├── pan_behavior.dart │ │ │ │ │ └── panning_tick_provider.dart │ │ │ ├── canvas_shapes.dart │ │ │ ├── chart_canvas.dart │ │ │ ├── chart_context.dart │ │ │ ├── datum_details.dart │ │ │ ├── processed_series.dart │ │ │ ├── selection_model │ │ │ │ └── selection_model.dart │ │ │ ├── series_datum.dart │ │ │ ├── series_renderer.dart │ │ │ ├── series_renderer_config.dart │ │ │ └── unitconverter │ │ │ │ ├── identity_converter.dart │ │ │ │ └── unit_converter.dart │ │ ├── layout │ │ │ ├── layout_config.dart │ │ │ ├── layout_manager.dart │ │ │ ├── layout_manager_impl.dart │ │ │ ├── layout_margin_strategy.dart │ │ │ └── layout_view.dart │ │ ├── line │ │ │ ├── line_chart.dart │ │ │ ├── line_renderer.dart │ │ │ └── line_renderer_config.dart │ │ ├── link │ │ │ ├── link_chart.dart │ │ │ ├── link_renderer.dart │ │ │ └── link_renderer_config.dart │ │ ├── pie │ │ │ ├── arc_label_decorator.dart │ │ │ ├── arc_renderer.dart │ │ │ ├── arc_renderer_config.dart │ │ │ ├── arc_renderer_decorator.dart │ │ │ ├── arc_renderer_element.dart │ │ │ ├── base_arc_renderer.dart │ │ │ ├── base_arc_renderer_config.dart │ │ │ └── pie_chart.dart │ │ ├── sankey │ │ │ ├── sankey_chart.dart │ │ │ ├── sankey_renderer.dart │ │ │ └── sankey_renderer_config.dart │ │ ├── scatter_plot │ │ │ ├── comparison_points_decorator.dart │ │ │ ├── point_renderer.dart │ │ │ ├── point_renderer_config.dart │ │ │ ├── point_renderer_decorator.dart │ │ │ ├── scatter_plot_chart.dart │ │ │ ├── symbol_annotation_renderer.dart │ │ │ └── symbol_annotation_renderer_config.dart │ │ ├── sunburst │ │ │ ├── sunburst_arc_label_decorator.dart │ │ │ ├── sunburst_arc_renderer.dart │ │ │ ├── sunburst_arc_renderer_config.dart │ │ │ └── sunburst_chart.dart │ │ ├── time_series │ │ │ └── time_series_chart.dart │ │ └── treemap │ │ │ ├── base_treemap_renderer.dart │ │ │ ├── dice_treemap_renderer.dart │ │ │ ├── slice_dice_treemap_renderer.dart │ │ │ ├── slice_treemap_renderer.dart │ │ │ ├── squarified_treemap_renderer.dart │ │ │ ├── treemap_chart.dart │ │ │ ├── treemap_label_decorator.dart │ │ │ ├── treemap_renderer_config.dart │ │ │ ├── treemap_renderer_decorator.dart │ │ │ └── treemap_renderer_element.dart │ │ ├── common │ │ ├── color.dart │ │ ├── date_time_factory.dart │ │ ├── gesture_listener.dart │ │ ├── graphics_factory.dart │ │ ├── line_style.dart │ │ ├── material_palette.dart │ │ ├── math.dart │ │ ├── paint_style.dart │ │ ├── palette.dart │ │ ├── performance.dart │ │ ├── proxy_gesture_listener.dart │ │ ├── rate_limit_utils.dart │ │ ├── rtl_spec.dart │ │ ├── style │ │ │ ├── material_style.dart │ │ │ ├── style.dart │ │ │ └── style_factory.dart │ │ ├── symbol_renderer.dart │ │ ├── text_element.dart │ │ ├── text_measurement.dart │ │ ├── text_style.dart │ │ ├── text_utils.dart │ │ └── typed_registry.dart │ │ └── data │ │ ├── graph.dart │ │ ├── graph_utils.dart │ │ ├── sankey_graph.dart │ │ ├── series.dart │ │ └── tree.dart ├── pubspec.yaml └── test │ ├── chart │ ├── bar │ │ ├── bar_label_decorator_test.dart │ │ ├── bar_renderer_test.dart │ │ ├── bar_target_line_renderer_test.dart │ │ └── renderer_nearest_detail_test.dart │ ├── cartesian │ │ ├── axis │ │ │ ├── auto_adjusting_static_tick_provider_test.dart │ │ │ ├── axis_test.dart │ │ │ ├── axis_tick_test.dart │ │ │ ├── bucketing_numeric_tick_provider_test.dart │ │ │ ├── draw_strategy │ │ │ │ └── tick_draw_strategy_test.dart │ │ │ ├── end_points_tick_provider_test.dart │ │ │ ├── linear │ │ │ │ └── linear_scale_test.dart │ │ │ ├── numeric_tick_provider_test.dart │ │ │ ├── ordinal_scale_test.dart │ │ │ ├── range_tick_provider_test.dart │ │ │ ├── static_tick_provider_test.dart │ │ │ └── time │ │ │ │ ├── basic_date_time_tick_formatter_spec_test.dart │ │ │ │ ├── date_time_tick_formatter_test.dart │ │ │ │ ├── simple_date_time_factory.dart │ │ │ │ ├── simple_time_tick_formatter_test.dart │ │ │ │ ├── time_stepper_test.dart │ │ │ │ └── time_tick_provider_test.dart │ │ ├── cartesian_chart_test.dart │ │ └── cartesian_renderer_test.dart │ ├── common │ │ ├── behavior │ │ │ ├── a11y │ │ │ │ └── domain_a11y_explore_behavior_test.dart │ │ │ ├── calculation │ │ │ │ └── percent_injector_test.dart │ │ │ ├── chart_behavior_test.dart │ │ │ ├── domain_highlighter_test.dart │ │ │ ├── initial_selection_test.dart │ │ │ ├── line_point_highlighter_test.dart │ │ │ ├── range_annotation_test.dart │ │ │ ├── selection │ │ │ │ ├── lock_selection_test.dart │ │ │ │ └── select_nearest_test.dart │ │ │ ├── series_legend_behavior_test.dart │ │ │ └── slider │ │ │ │ └── slider_test.dart │ │ ├── gesture_listener_test.dart │ │ └── selection_model │ │ │ └── selection_model_test.dart │ ├── layout │ │ └── layout_manager_impl_test.dart │ ├── line │ │ ├── line_renderer_test.dart │ │ └── renderer_nearest_detail_test.dart │ ├── pie │ │ └── arc_label_decorator_test.dart │ ├── scatter_plot │ │ ├── comparison_points_decorator_test.dart │ │ ├── point_renderer_test.dart │ │ ├── renderer_nearest_detail_test.dart │ │ └── symbol_annotation_renderer_test.dart │ ├── sunburst │ │ └── sunburst_arc_label_decorator_test.dart │ └── treemap │ │ └── treemap_label_decorator_test.dart │ ├── common │ └── text_utils_test.dart │ └── data │ ├── graph_test.dart │ ├── graph_utils_test.dart │ └── sankey_graph_test.dart ├── charts_flutter ├── CHANGELOG.md ├── LICENSE ├── README.md ├── charts_flutter.gwsq ├── example │ ├── android.iml │ ├── android │ │ ├── .gitignore │ │ ├── Android_Charts.xml │ │ ├── app │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ ├── com │ │ │ │ │ └── example │ │ │ │ │ │ └── examples │ │ │ │ │ │ └── MainActivity.java │ │ │ │ └── io │ │ │ │ │ └── flutter │ │ │ │ │ └── plugins │ │ │ │ │ └── GeneratedPluginRegistrant.java │ │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle │ ├── examples.iml │ ├── examples_android.iml │ ├── ios │ │ ├── Flutter │ │ │ ├── AppFrameworkInfo.plist │ │ │ ├── Debug.xcconfig │ │ │ └── Release.xcconfig │ │ ├── Ios_Charts.xml │ │ ├── Runner.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── Runner │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── Icon-60@2x.png │ │ │ │ ├── Icon-60@3x.png │ │ │ │ ├── Icon-76.png │ │ │ │ ├── Icon-76@2x.png │ │ │ │ ├── Icon-83.5@2x.png │ │ │ │ ├── Icon-Small-40.png │ │ │ │ ├── Icon-Small-40@2x.png │ │ │ │ ├── Icon-Small-40@3x.png │ │ │ │ ├── Icon-Small.png │ │ │ │ ├── Icon-Small@2x.png │ │ │ │ └── Icon-Small@3x.png │ │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ └── main.m │ ├── lib │ │ ├── a11y │ │ │ ├── a11y_gallery.dart │ │ │ └── domain_a11y_explore_bar_chart.dart │ │ ├── app_config.dart │ │ ├── axes │ │ │ ├── axes_gallery.dart │ │ │ ├── bar_secondary_axis.dart │ │ │ ├── bar_secondary_axis_only.dart │ │ │ ├── custom_axis_tick_formatters.dart │ │ │ ├── custom_font_size_and_color.dart │ │ │ ├── custom_measure_tick_count.dart │ │ │ ├── flipped_vertical_axis.dart │ │ │ ├── gridline_dash_pattern.dart │ │ │ ├── hidden_ticks_and_labels_axis.dart │ │ │ ├── horizontal_bar_secondary_axis.dart │ │ │ ├── integer_only_measure_axis.dart │ │ │ ├── line_disjoint_axis.dart │ │ │ ├── measure_axis_label_alignment.dart │ │ │ ├── nonzero_bound_measure_axis.dart │ │ │ ├── numeric_initial_viewport.dart │ │ │ ├── ordinal_initial_viewport.dart │ │ │ ├── short_tick_length_axis.dart │ │ │ └── statically_provided_ticks.dart │ │ ├── bar_chart │ │ │ ├── bar_gallery.dart │ │ │ ├── custom_rounded_bars.dart │ │ │ ├── grouped.dart │ │ │ ├── grouped_fill_color.dart │ │ │ ├── grouped_single_target_line.dart │ │ │ ├── grouped_stacked.dart │ │ │ ├── grouped_stacked_weight_pattern.dart │ │ │ ├── grouped_target_line.dart │ │ │ ├── horizontal.dart │ │ │ ├── horizontal_bar_label.dart │ │ │ ├── horizontal_bar_label_custom.dart │ │ │ ├── horizontal_pattern_forward_hatch.dart │ │ │ ├── pattern_forward_hatch.dart │ │ │ ├── simple.dart │ │ │ ├── spark_bar.dart │ │ │ ├── stacked.dart │ │ │ ├── stacked_fill_color.dart │ │ │ ├── stacked_horizontal.dart │ │ │ ├── stacked_target_line.dart │ │ │ └── vertical_bar_label.dart │ │ ├── behaviors │ │ │ ├── behaviors_gallery.dart │ │ │ ├── chart_title.dart │ │ │ ├── initial_hint_animation.dart │ │ │ ├── initial_selection.dart │ │ │ ├── percent_of_domain.dart │ │ │ ├── percent_of_domain_by_category.dart │ │ │ ├── percent_of_series.dart │ │ │ ├── selection_bar_highlight.dart │ │ │ ├── selection_callback_example.dart │ │ │ ├── selection_line_highlight.dart │ │ │ ├── selection_line_highlight_custom_shape.dart │ │ │ ├── selection_scatter_plot_highlight.dart │ │ │ ├── selection_user_managed.dart │ │ │ ├── slider.dart │ │ │ └── sliding_viewport_on_selection.dart │ │ ├── combo_chart │ │ │ ├── combo_gallery.dart │ │ │ ├── date_time_line_point.dart │ │ │ ├── numeric_line_bar.dart │ │ │ ├── numeric_line_point.dart │ │ │ ├── ordinal_bar_line.dart │ │ │ └── scatter_plot_line.dart │ │ ├── drawer.dart │ │ ├── gallery_scaffold.dart │ │ ├── home.dart │ │ ├── i18n │ │ │ ├── i18n_gallery.dart │ │ │ ├── rtl_bar_chart.dart │ │ │ ├── rtl_line_chart.dart │ │ │ ├── rtl_line_segments.dart │ │ │ └── rtl_series_legend.dart │ │ ├── legends │ │ │ ├── datum_legend_options.dart │ │ │ ├── datum_legend_with_measures.dart │ │ │ ├── default_hidden_series_legend.dart │ │ │ ├── legend_custom_symbol.dart │ │ │ ├── legends_gallery.dart │ │ │ ├── series_legend_options.dart │ │ │ ├── series_legend_with_measures.dart │ │ │ ├── simple_datum_legend.dart │ │ │ └── simple_series_legend.dart │ │ ├── line_chart │ │ │ ├── animation_zoom.dart │ │ │ ├── area_and_line.dart │ │ │ ├── dash_pattern.dart │ │ │ ├── line_annotation.dart │ │ │ ├── line_gallery.dart │ │ │ ├── points.dart │ │ │ ├── range_annotation.dart │ │ │ ├── range_annotation_margin.dart │ │ │ ├── segments.dart │ │ │ ├── simple.dart │ │ │ ├── simple_nulls.dart │ │ │ ├── stacked_area.dart │ │ │ ├── stacked_area_custom_color.dart │ │ │ └── stacked_area_nulls.dart │ │ ├── main.dart │ │ ├── pie_chart │ │ │ ├── auto_label.dart │ │ │ ├── donut.dart │ │ │ ├── gauge.dart │ │ │ ├── outside_label.dart │ │ │ ├── partial_pie.dart │ │ │ ├── pie_gallery.dart │ │ │ └── simple.dart │ │ ├── scatter_plot_chart │ │ │ ├── animation_zoom.dart │ │ │ ├── bucketing_axis.dart │ │ │ ├── comparison_points.dart │ │ │ ├── scatter_plot_gallery.dart │ │ │ ├── shapes.dart │ │ │ └── simple.dart │ │ └── time_series_chart │ │ │ ├── confidence_interval.dart │ │ │ ├── end_points_axis.dart │ │ │ ├── line_annotation.dart │ │ │ ├── range_annotation.dart │ │ │ ├── range_annotation_margin.dart │ │ │ ├── simple.dart │ │ │ ├── symbol_annotation.dart │ │ │ ├── time_series_gallery.dart │ │ │ └── with_bar_renderer.dart │ └── pubspec.yaml ├── lib │ ├── flutter.dart │ └── src │ │ ├── bar_chart.dart │ │ ├── base_chart.dart │ │ ├── base_chart_state.dart │ │ ├── behaviors │ │ ├── a11y │ │ │ └── domain_a11y_explore_behavior.dart │ │ ├── calculation │ │ │ └── percent_injector.dart │ │ ├── chart_behavior.dart │ │ ├── chart_title │ │ │ └── chart_title.dart │ │ ├── domain_highlighter.dart │ │ ├── initial_selection.dart │ │ ├── legend │ │ │ ├── datum_legend.dart │ │ │ ├── legend.dart │ │ │ ├── legend_content_builder.dart │ │ │ ├── legend_entry_layout.dart │ │ │ ├── legend_layout.dart │ │ │ └── series_legend.dart │ │ ├── line_point_highlighter.dart │ │ ├── range_annotation.dart │ │ ├── select_nearest.dart │ │ ├── slider │ │ │ └── slider.dart │ │ ├── sliding_viewport.dart │ │ └── zoom │ │ │ ├── initial_hint_behavior.dart │ │ │ ├── pan_and_zoom_behavior.dart │ │ │ └── pan_behavior.dart │ │ ├── canvas │ │ ├── circle_sector_painter.dart │ │ ├── line_painter.dart │ │ ├── pie_painter.dart │ │ ├── point_painter.dart │ │ └── polygon_painter.dart │ │ ├── cartesian_chart.dart │ │ ├── chart_canvas.dart │ │ ├── chart_container.dart │ │ ├── chart_gesture_detector.dart │ │ ├── chart_state.dart │ │ ├── combo_chart │ │ └── combo_chart.dart │ │ ├── graphics_factory.dart │ │ ├── line_chart.dart │ │ ├── line_style.dart │ │ ├── pie_chart.dart │ │ ├── scatter_plot_chart.dart │ │ ├── selection_model_config.dart │ │ ├── symbol_renderer.dart │ │ ├── text_element.dart │ │ ├── text_style.dart │ │ ├── time_series_chart.dart │ │ ├── user_managed_state.dart │ │ ├── util.dart │ │ ├── util │ │ └── color.dart │ │ └── widget_layout_delegate.dart ├── minimum_os.bzl ├── pubspec.yaml └── test │ ├── behaviors │ └── legend │ │ └── legend_layout_test.dart │ ├── text_element_test.dart │ ├── user_managed_state_test.dart │ └── widget_layout_delegate_test.dart └── docs ├── Gemfile ├── Gemfile.lock ├── flutter ├── example │ ├── a11ys │ │ ├── domain_a11y_explore_bar_chart.md │ │ ├── domain_a11y_explore_bar_chart_full.png │ │ └── domain_a11y_explore_bar_chart_thumb.png │ ├── axes │ │ ├── bar_secondary_axis.md │ │ ├── bar_secondary_axis_full.png │ │ ├── bar_secondary_axis_only.md │ │ ├── bar_secondary_axis_only_full.png │ │ ├── bar_secondary_axis_only_thumb.png │ │ ├── bar_secondary_axis_thumb.png │ │ ├── custom_axis_tick_formatters.md │ │ ├── custom_axis_tick_formatters_full.png │ │ ├── custom_axis_tick_formatters_thumb.png │ │ ├── custom_font_size_and_color.md │ │ ├── custom_font_size_and_color_full.png │ │ ├── custom_font_size_and_color_thumb.png │ │ ├── custom_measure_tick_count.md │ │ ├── custom_measure_tick_count_full.png │ │ ├── custom_measure_tick_count_thumb.png │ │ ├── flipped_vertical_axis.md │ │ ├── flipped_vertical_axis_full.png │ │ ├── flipped_vertical_axis_thumb.png │ │ ├── gridline_dash_pattern.md │ │ ├── gridline_dash_pattern_full.png │ │ ├── gridline_dash_pattern_thumb.png │ │ ├── hidden_ticks_and_labels_axis.md │ │ ├── hidden_ticks_and_labels_axis_full.png │ │ ├── hidden_ticks_and_labels_axis_thumb.png │ │ ├── horizontal_bar_secondary_axis.md │ │ ├── horizontal_bar_secondary_axis_full.png │ │ ├── horizontal_bar_secondary_axis_thumb.png │ │ ├── integer_only_measure_axis.md │ │ ├── integer_only_measure_axis_full.png │ │ ├── integer_only_measure_axis_thumb.png │ │ ├── line_disjoint_axis.md │ │ ├── line_disjoint_axis_full.png │ │ ├── line_disjoint_axis_thumb.png │ │ ├── measure_axis_label_alignment.md │ │ ├── measure_axis_label_alignment_full.png │ │ ├── measure_axis_label_alignment_thumb.png │ │ ├── nonzero_bound_measure_axis.md │ │ ├── nonzero_bound_measure_axis_full.png │ │ ├── nonzero_bound_measure_axis_thumb.png │ │ ├── numeric_initial_viewport.md │ │ ├── numeric_initial_viewport_full.png │ │ ├── numeric_initial_viewport_thumb.png │ │ ├── ordinal_initial_viewport.md │ │ ├── ordinal_initial_viewport.png │ │ ├── ordinal_initial_viewport_full.png │ │ ├── ordinal_initial_viewport_thumb.png │ │ ├── short_tick_length_axis.md │ │ ├── short_tick_length_axis_full.png │ │ ├── short_tick_length_axis_thumb.png │ │ ├── statically_provided_ticks.md │ │ ├── statically_provided_ticks_full.png │ │ └── statically_provided_ticks_thumb.png │ ├── bar_charts │ │ ├── custom_rounded_bars.md │ │ ├── custom_rounded_bars_full.png │ │ ├── custom_rounded_bars_thumb.png │ │ ├── grouped.md │ │ ├── grouped_fill_color.md │ │ ├── grouped_fill_color_full.png │ │ ├── grouped_fill_color_thumb.png │ │ ├── grouped_full.png │ │ ├── grouped_stacked.md │ │ ├── grouped_stacked_full.png │ │ ├── grouped_stacked_thumb.png │ │ ├── grouped_stacked_weight_pattern.md │ │ ├── grouped_stacked_weight_pattern_full.png │ │ ├── grouped_stacked_weight_pattern_thumb.png │ │ ├── grouped_target_line.md │ │ ├── grouped_target_line_full.png │ │ ├── grouped_target_line_thumb.png │ │ ├── grouped_thumb.png │ │ ├── horizontal.md │ │ ├── horizontal_bar_label.md │ │ ├── horizontal_bar_label_custom.md │ │ ├── horizontal_bar_label_custom_full.png │ │ ├── horizontal_bar_label_custom_thumb.png │ │ ├── horizontal_bar_label_full.png │ │ ├── horizontal_bar_label_thumb.png │ │ ├── horizontal_full.png │ │ ├── horizontal_pattern_forward_hatch.md │ │ ├── horizontal_pattern_forward_hatch_full.png │ │ ├── horizontal_pattern_forward_hatch_thumb.png │ │ ├── horizontal_thumb.png │ │ ├── pattern_forward_hatch.md │ │ ├── pattern_forward_hatch_full.png │ │ ├── pattern_forward_hatch_thumb.png │ │ ├── simple.md │ │ ├── simple_full.png │ │ ├── simple_thumb.png │ │ ├── spark_bar.md │ │ ├── spark_bar_full.png │ │ ├── spark_bar_thumb.png │ │ ├── stacked.md │ │ ├── stacked_fill_color.md │ │ ├── stacked_fill_color_full.png │ │ ├── stacked_fill_color_thumb.png │ │ ├── stacked_full.png │ │ ├── stacked_horizontal.md │ │ ├── stacked_horizontal_full.png │ │ ├── stacked_horizontal_thumb.png │ │ ├── stacked_target_line.md │ │ ├── stacked_target_line_full.png │ │ ├── stacked_target_line_thumb.png │ │ ├── stacked_thumb.png │ │ ├── vertical_bar_label.md │ │ ├── vertical_bar_label_full.png │ │ └── vertical_bar_label_thumb.png │ ├── behaviors │ │ ├── chart_title.md │ │ ├── chart_title_full.png │ │ ├── chart_title_thumb.png │ │ ├── initial_hint_animation.md │ │ ├── initial_hint_animation_full.png │ │ ├── initial_hint_animation_thumb.png │ │ ├── initial_selection.md │ │ ├── initial_selection_full.png │ │ ├── initial_selection_thumb.png │ │ ├── percent_of_domain.md │ │ ├── percent_of_domain_by_category.md │ │ ├── percent_of_domain_by_category_full.png │ │ ├── percent_of_domain_by_category_thumb.png │ │ ├── percent_of_domain_full.png │ │ ├── percent_of_domain_thumb.png │ │ ├── percent_of_series.md │ │ ├── percent_of_series_full.png │ │ ├── percent_of_series_thumb.png │ │ ├── selection_bar_highlight.md │ │ ├── selection_bar_highlight_full.png │ │ ├── selection_bar_highlight_thumb.png │ │ ├── selection_callback_example.md │ │ ├── selection_callback_example_full.png │ │ ├── selection_callback_example_thumb.png │ │ ├── selection_line_highlight.md │ │ ├── selection_line_highlight_full.png │ │ ├── selection_line_highlight_thumb.png │ │ ├── selection_user_managed.md │ │ ├── selection_user_managed_full.png │ │ ├── selection_user_managed_thumb.png │ │ ├── slider.md │ │ ├── slider_full.png │ │ ├── slider_thumb.png │ │ ├── sliding_viewport_on_selection.md │ │ ├── sliding_viewport_on_selection_full.png │ │ └── sliding_viewport_on_selection_thumb.png │ ├── combo_charts │ │ ├── date_time_line_point.md │ │ ├── date_time_line_point_full.png │ │ ├── date_time_line_point_thumb.png │ │ ├── numeric_line_bar.md │ │ ├── numeric_line_bar_full.png │ │ ├── numeric_line_bar_thumb.png │ │ ├── numeric_line_point.md │ │ ├── numeric_line_point_full.png │ │ ├── numeric_line_point_thumb.png │ │ ├── ordinal_bar_line.md │ │ ├── ordinal_bar_line_full.png │ │ ├── ordinal_bar_line_thumb.png │ │ ├── scatter_plot_line.md │ │ ├── scatter_plot_line_full.png │ │ └── scatter_plot_line_thumb.png │ ├── i18ns │ │ ├── rtl_bar_chart.md │ │ ├── rtl_bar_chart_full.png │ │ ├── rtl_bar_chart_thumb.png │ │ ├── rtl_line_chart.md │ │ ├── rtl_line_chart_full.png │ │ ├── rtl_line_chart_thumb.png │ │ ├── rtl_line_segments.md │ │ ├── rtl_line_segments_full.png │ │ ├── rtl_line_segments_thumb.png │ │ ├── rtl_series_legend.md │ │ ├── rtl_series_legend_full.png │ │ └── rtl_series_legend_thumb.png │ ├── legends │ │ ├── datum_legend_options.md │ │ ├── datum_legend_options_full.png │ │ ├── datum_legend_options_thumb.png │ │ ├── datum_legend_with_measures.md │ │ ├── datum_legend_with_measures_full.png │ │ ├── datum_legend_with_measures_thumb.png │ │ ├── default_hidden_series_legend.md │ │ ├── default_hidden_series_legend_full.png │ │ ├── default_hidden_series_legend_thumb.png │ │ ├── legend_custom_symbol.md │ │ ├── legend_custom_symbol_full.png │ │ ├── legend_custom_symbol_thumb.png │ │ ├── series_legend_options.md │ │ ├── series_legend_options_full.png │ │ ├── series_legend_options_thumb.png │ │ ├── series_legend_with_measures.md │ │ ├── series_legend_with_measures_full.png │ │ ├── series_legend_with_measures_thumb.png │ │ ├── simple_datum_legend.md │ │ ├── simple_datum_legend_full.png │ │ ├── simple_datum_legend_thumb.png │ │ ├── simple_series_legend.md │ │ ├── simple_series_legend_full.png │ │ └── simple_series_legend_thumb.png │ ├── line_charts │ │ ├── area_and_line.md │ │ ├── area_and_line_full.png │ │ ├── area_and_line_thumb.png │ │ ├── dash_pattern.md │ │ ├── dash_pattern_full.png │ │ ├── dash_pattern_thumb.png │ │ ├── line_annotation.md │ │ ├── line_annotation_full.png │ │ ├── line_annotation_thumb.png │ │ ├── points.md │ │ ├── points_full.png │ │ ├── points_thumb.png │ │ ├── range_annotation.md │ │ ├── range_annotation_full.png │ │ ├── range_annotation_margin.md │ │ ├── range_annotation_margin_full.png │ │ ├── range_annotation_margin_thumb.png │ │ ├── range_annotation_thumb.png │ │ ├── segments.md │ │ ├── segments_full.png │ │ ├── segments_thumb.png │ │ ├── simple.md │ │ ├── simple_full.png │ │ ├── simple_nulls.md │ │ ├── simple_nulls_full.png │ │ ├── simple_nulls_thumb.png │ │ ├── simple_thumb.png │ │ ├── stacked_area.md │ │ ├── stacked_area_custom_color.md │ │ ├── stacked_area_custom_color_full.png │ │ ├── stacked_area_custom_color_thumb.png │ │ ├── stacked_area_full.png │ │ ├── stacked_area_nulls.md │ │ ├── stacked_area_nulls_full.png │ │ ├── stacked_area_nulls_thumb.png │ │ └── stacked_area_thumb.png │ ├── pie_charts │ │ ├── auto_label.md │ │ ├── auto_label_full.png │ │ ├── auto_label_thumb.png │ │ ├── donut.md │ │ ├── donut_full.png │ │ ├── donut_thumb.png │ │ ├── gauge.md │ │ ├── gauge_full.png │ │ ├── gauge_thumb.png │ │ ├── outside_label.md │ │ ├── outside_label_full.png │ │ ├── outside_label_thumb.png │ │ ├── partial_pie.md │ │ ├── partial_pie_full.png │ │ ├── partial_pie_thumb.png │ │ ├── simple.md │ │ ├── simple_full.png │ │ └── simple_thumb.png │ ├── scatter_plot_charts │ │ ├── bucketing_axis.md │ │ ├── bucketing_axis_full.png │ │ ├── bucketing_axis_thumb.png │ │ ├── comparison_points.md │ │ ├── comparison_points_full.png │ │ ├── comparison_points_thumb.png │ │ ├── shapes.md │ │ ├── shapes_full.png │ │ ├── shapes_thumb.png │ │ ├── simple.md │ │ ├── simple_full.png │ │ └── simple_thumb.png │ └── time_series_charts │ │ ├── confidence_interval.md │ │ ├── confidence_interval_full.png │ │ ├── confidence_interval_thumb.png │ │ ├── end_points_axis.md │ │ ├── end_points_axis_full.png │ │ ├── end_points_axis_thumb.png │ │ ├── line_annotation.md │ │ ├── line_annotation_full.png │ │ ├── line_annotation_thumb.png │ │ ├── range_annotation.md │ │ ├── range_annotation_full.png │ │ ├── range_annotation_margin.md │ │ ├── range_annotation_margin_full.png │ │ ├── range_annotation_margin_thumb.png │ │ ├── range_annotation_thumb.png │ │ ├── simple.md │ │ ├── simple_full.png │ │ ├── simple_thumb.png │ │ ├── symbol_annotation.md │ │ ├── symbol_annotation_full.png │ │ ├── symbol_annotation_thumb.png │ │ ├── with_bar_renderer.md │ │ ├── with_bar_renderer_full.png │ │ └── with_bar_renderer_thumb.png └── gallery.md └── index.md /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-20.04 8 | strategy: 9 | matrix: 10 | channel: [master, stable] 11 | # Disable fail-fast; we want results from all channels even if one fails. 12 | fail-fast: false 13 | 14 | steps: 15 | - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f 16 | with: 17 | path: charts 18 | - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f 19 | with: 20 | path: flutter 21 | repository: flutter/flutter 22 | ref: ${{ matrix.channel }} 23 | # Shallow clones don't work; see https://github.com/flutter/flutter/issues/18532 24 | fetch-depth: 0 25 | - name: Add Flutter tags 26 | # Add tags, which are also necessary for version checks to work. 27 | run: git fetch origin +refs/tags/*:refs/tags/* 28 | working-directory: ${{ github.workspace }}/flutter 29 | - name: Add Flutter to path 30 | run: echo "$GITHUB_WORKSPACE/flutter/bin" >> $GITHUB_PATH 31 | - name: Doctor 32 | # Run doctor, for ease of debugging any issues. 33 | run: flutter doctor -v 34 | - name: charts_common tests 35 | run: | 36 | dart pub get 37 | dart pub run test 38 | working-directory: ${{ github.workspace }}/charts/charts_common 39 | - name: charts_flutter tests 40 | run: flutter test 41 | working-directory: ${{ github.workspace }}/charts/charts_flutter 42 | 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .dart_tool/ 2 | .packages 3 | pubspec.lock 4 | 5 | .bundle 6 | _site 7 | 8 | build/ 9 | **/ios/.generated/ 10 | **/ios/Flutter/Generated.xcconfig 11 | **/ios/Runner/GeneratedPluginRegistrant.* 12 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Below is a list of people and organizations that have contributed 2 | # to the Charts project. Names should be added to the list like so: 3 | # 4 | # Name/Organization 5 | 6 | Google Inc. 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | This project is no longer maintained, and will not receive further updates. 2 | Community members interested in collaborating on a community-maintained fork can 3 | coordinate in [this issue](https://github.com/google/charts/issues/798). 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Remark 2 | 3 | [Upstream](https://github.com/google/charts/issues/798) discontinues working on it; I may not have enough time on my own to maintain it, but at least I will ensure it is runnable (for example, no compile errors or warnings on latest Flutter version). 4 | 5 | --- 6 | 7 | Charts is a general charting library, currently enabled for the 8 | [Flutter mobile UI framework](https://flutter.io). 9 | 10 | See the [online gallery](https://google.github.io/charts/flutter/gallery.html) for supported chart 11 | types and examples of how to custom components of the chart. 12 | 13 | *Note*: This is not an official Google product. 14 | 15 | [![Travis CI Build Status](https://travis-ci.org/google/charts.svg?branch=master)](https://travis-ci.org/google/charts) 16 | 17 | ## charts_common 18 | 19 | [![charts_common pub package](https://img.shields.io/pub/v/charts_common.svg)](https://pub.dartlang.org/packages/charts_common) 20 | 21 | A common library for charting packages. 22 | 23 | ## charts_flutter 24 | 25 | [![charts_flutter pub package](https://img.shields.io/pub/v/charts_flutter.svg)](https://pub.dartlang.org/packages/charts_flutter) 26 | 27 | A charting package for [Flutter](https://flutter.io), supporting both Android 28 | and iOS. 29 | 30 | All charts packages are licensed under the Apache 2 license, see the 31 | [LICENSE](LICENSE) and [AUTHORS](AUTHORS) files for details. 32 | -------------------------------------------------------------------------------- /charts_common/README.md: -------------------------------------------------------------------------------- 1 | # Common Charting library 2 | 3 | [![pub package](https://img.shields.io/pub/v/charts_common.svg)](https://pub.dartlang.org/packages/charts_common) 4 | 5 | Common componnets for charting libraries. 6 | 7 | ## Development 8 | This project is developed internally at Google and published for external 9 | consumption, external contributions unfortunately cannot be taken at this time. 10 | -------------------------------------------------------------------------------- /charts_common/charts_common.gwsq: -------------------------------------------------------------------------------- 1 | send_cls_to('dart-charts-team+reviews'); 2 | send_cls_to('dart-charts-team'); 3 | 4 | define Main { 5 | reassign_to_list(from_owners_file('third_party/dart/charts_common/OWNERS')); 6 | } 7 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/bar/bar_chart.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:collection' show LinkedHashMap; 17 | 18 | import '../bar/bar_renderer.dart' show BarRenderer; 19 | import '../cartesian/axis/axis.dart' show NumericAxis; 20 | import '../cartesian/cartesian_chart.dart' show OrdinalCartesianChart; 21 | import '../common/series_renderer.dart' show SeriesRenderer; 22 | import '../layout/layout_config.dart' show LayoutConfig; 23 | 24 | class BarChart extends OrdinalCartesianChart { 25 | BarChart( 26 | {bool? vertical, 27 | LayoutConfig? layoutConfig, 28 | NumericAxis? primaryMeasureAxis, 29 | NumericAxis? secondaryMeasureAxis, 30 | LinkedHashMap? disjointMeasureAxes}) 31 | : super( 32 | vertical: vertical, 33 | layoutConfig: layoutConfig, 34 | primaryMeasureAxis: primaryMeasureAxis, 35 | secondaryMeasureAxis: secondaryMeasureAxis, 36 | disjointMeasureAxes: disjointMeasureAxes); 37 | 38 | @override 39 | SeriesRenderer makeDefaultRenderer() { 40 | return BarRenderer()..rendererId = SeriesRenderer.defaultRendererId; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/bar/bar_renderer_decorator.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:math' show Rectangle; 17 | 18 | import '../../common/graphics_factory.dart' show GraphicsFactory; 19 | import '../common/chart_canvas.dart' show ChartCanvas; 20 | import 'bar_renderer.dart' show ImmutableBarRendererElement; 21 | 22 | /// Decorates bars after the bars have already been painted. 23 | abstract class BarRendererDecorator { 24 | const BarRendererDecorator(); 25 | 26 | void decorate(Iterable> barElements, 27 | ChartCanvas canvas, GraphicsFactory graphicsFactory, 28 | {required Rectangle drawBounds, 29 | required double animationPercent, 30 | required bool renderingVertically, 31 | bool rtl = false}); 32 | } 33 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/collision_report.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'tick.dart' show Tick; 17 | 18 | /// A report that contains a list of ticks and if they collide. 19 | class CollisionReport { 20 | /// If [ticks] collide. 21 | final bool ticksCollide; 22 | 23 | final List> ticks; 24 | 25 | final bool alternateTicksUsed; 26 | 27 | CollisionReport( 28 | {required this.ticksCollide, 29 | required List>? ticks, 30 | bool? alternateTicksUsed}) 31 | : ticks = ticks ?? [], 32 | alternateTicksUsed = alternateTicksUsed ?? false; 33 | 34 | CollisionReport.empty() 35 | : ticksCollide = false, 36 | ticks = [], 37 | alternateTicksUsed = false; 38 | } 39 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/ordinal_extents.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:collection' show HashSet; 17 | import 'scale.dart' show Extents; 18 | 19 | /// A range of ordinals. 20 | class OrdinalExtents extends Extents { 21 | final List _range; 22 | 23 | /// The extents representing the ordinal values in [range]. 24 | /// 25 | /// The elements of [range] must all be unique. 26 | /// 27 | /// [D] is the domain class type for the elements in the extents. 28 | OrdinalExtents(List range) : _range = range { 29 | // This asserts that all elements in [range] are unique. 30 | assert(() { 31 | final uniqueValueCount = HashSet.of(_range).length; 32 | return uniqueValueCount == range.length; 33 | }()); 34 | } 35 | 36 | factory OrdinalExtents.all(List range) => OrdinalExtents(range); 37 | 38 | bool get isEmpty => _range.isEmpty; 39 | 40 | /// The number of values inside this extent. 41 | int get length => _range.length; 42 | 43 | String? operator [](int index) => _range[index]; 44 | 45 | int indexOf(String value) => _range.indexOf(value); 46 | } 47 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/ordinal_scale.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'ordinal_scale_domain_info.dart' show OrdinalScaleDomainInfo; 17 | import 'scale.dart' show MutableScale; 18 | 19 | abstract class OrdinalScale extends MutableScale { 20 | /// The current domain collection with all added unique values. 21 | OrdinalScaleDomainInfo get domain; 22 | 23 | /// Sets the viewport of the scale based on the number of data points to show 24 | /// and the starting domain value. 25 | /// 26 | /// [viewportDataSize] How many ordinal domain values to show in the viewport. 27 | /// [startingDomain] The starting domain value of the viewport. Note that if 28 | /// the starting domain is in terms of position less than [domainValuesToShow] 29 | /// from the last domain value the viewport will be fixed to the last value 30 | /// and not guaranteed that this domain value is the first in the viewport. 31 | void setViewport(int? viewportDataSize, String? startingDomain); 32 | 33 | /// The number of full ordinal steps that fit in the viewport. 34 | int get viewportDataSize; 35 | 36 | /// The first fully visible ordinal step within the viewport. 37 | /// 38 | /// Start is defined by the leftmost domain for horizontal axes, and 39 | /// topmost domain for vertical axes. 40 | /// 41 | /// Null if no domains exist. 42 | String? get viewportStartingDomain; 43 | } 44 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/range_axis_tick.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'axis_tick.dart' show AxisTicks; 17 | import 'range_tick.dart' show RangeTick; 18 | 19 | class RangeAxisTicks extends AxisTicks { 20 | /// The value that this range tick starting point represents 21 | final D rangeStartValue; 22 | 23 | /// Position of the range tick starting point. 24 | double rangeStartLocationPx; 25 | 26 | /// The value that this range tick ending point represents. 27 | final D rangeEndValue; 28 | 29 | /// Position of the range tick ending point. 30 | double rangeEndLocationPx; 31 | 32 | RangeAxisTicks(RangeTick tick) 33 | : rangeStartValue = tick.rangeStartValue, 34 | rangeStartLocationPx = tick.rangeStartLocationPx, 35 | rangeEndValue = tick.rangeEndValue, 36 | rangeEndLocationPx = tick.rangeEndLocationPx, 37 | super(tick); 38 | } 39 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/spec/range_tick_spec.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'axis_spec.dart' show TextStyleSpec; 17 | import 'tick_spec.dart' show TickSpec; 18 | 19 | /// Definition for a range tick. 20 | /// 21 | /// Used to define a tick that is used by range tick provider. 22 | class RangeTickSpec extends TickSpec { 23 | final D rangeStartValue; 24 | final D rangeEndValue; 25 | 26 | /// Creates a range tick for [value]. 27 | /// A [label] optionally labels this tick. If not set, the tick formatter 28 | /// formatter of the axis is used. 29 | /// A [style] optionally sets the style for this tick. If not set, the style 30 | /// of the axis is used. 31 | /// A [rangeStartValue] represents value of this range tick's starting point. 32 | /// A [rangeEndValue] represents the value of this range tick's ending point. 33 | const RangeTickSpec( 34 | D value, { 35 | String? label, 36 | TextStyleSpec? style, 37 | required this.rangeStartValue, 38 | required this.rangeEndValue, 39 | }) : super(value, label: label, style: style); 40 | } 41 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/spec/tick_spec.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'axis_spec.dart' show TextStyleSpec; 17 | 18 | /// Definition for a tick. 19 | /// 20 | /// Used to define a tick that is used by static tick provider. 21 | class TickSpec { 22 | final D value; 23 | final String? label; 24 | final TextStyleSpec? style; 25 | 26 | /// [value] the value of this tick 27 | /// [label] optional label for this tick. If not set, uses the tick formatter 28 | /// of the axis. 29 | /// [style] optional style for this tick. If not set, uses the style of the 30 | /// axis. 31 | const TickSpec(this.value, {this.label, this.style}); 32 | } 33 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/tick.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import '../../../common/text_element.dart'; 17 | 18 | /// A labeled point on an axis. 19 | /// 20 | /// [D] is the type of the value this tick is associated with. 21 | class Tick { 22 | /// The value that this tick represents 23 | final D value; 24 | 25 | /// [TextElement] for this tick. 26 | TextElement? textElement; 27 | 28 | /// Location on the axis where this tick is rendered (in canvas coordinates). 29 | double? locationPx; 30 | 31 | /// Offset of the label for this tick from its location. 32 | /// 33 | /// This is a vertical offset for ticks on a vertical axis, or horizontal 34 | /// offset for ticks on a horizontal axis. 35 | double? labelOffsetPx; 36 | 37 | Tick( 38 | {required this.value, 39 | required this.textElement, 40 | this.locationPx, 41 | this.labelOffsetPx}); 42 | 43 | @override 44 | String toString() => 'Tick(value: $value, locationPx: $locationPx, ' 45 | 'labelOffsetPx: $labelOffsetPx)'; 46 | } 47 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/time/date_time_axis.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import '../../../../common/date_time_factory.dart' show DateTimeFactory; 17 | import '../axis.dart' show Axis; 18 | import '../tick_formatter.dart' show TickFormatter; 19 | import '../tick_provider.dart' show TickProvider; 20 | import 'auto_adjusting_date_time_tick_provider.dart' 21 | show AutoAdjustingDateTimeTickProvider; 22 | import 'date_time_extents.dart' show DateTimeExtents; 23 | import 'date_time_scale.dart' show DateTimeScale; 24 | import 'date_time_tick_formatter.dart' show DateTimeTickFormatter; 25 | 26 | class DateTimeAxis extends Axis { 27 | DateTimeAxis(DateTimeFactory dateTimeFactory, 28 | {TickProvider? tickProvider, 29 | TickFormatter? tickFormatter}) 30 | : super( 31 | tickProvider: tickProvider ?? 32 | AutoAdjustingDateTimeTickProvider.createDefault(dateTimeFactory), 33 | tickFormatter: 34 | tickFormatter ?? DateTimeTickFormatter(dateTimeFactory), 35 | scale: DateTimeScale(dateTimeFactory), 36 | ); 37 | 38 | void setScaleViewport(DateTimeExtents viewport) { 39 | autoViewport = false; 40 | (mutableScale as DateTimeScale).viewportDomain = viewport; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/time/date_time_extents.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import '../scale.dart' show Extents; 17 | 18 | class DateTimeExtents extends Extents { 19 | final DateTime start; 20 | final DateTime end; 21 | 22 | DateTimeExtents({required this.start, required this.end}); 23 | 24 | @override 25 | bool operator ==(Object other) { 26 | return other is DateTimeExtents && start == other.start && end == other.end; 27 | } 28 | 29 | @override 30 | int get hashCode => start.hashCode + (end.hashCode * 37); 31 | } 32 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/time/hour_tick_formatter.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:intl/intl.dart' show DateFormat; 17 | import '../../../../common/date_time_factory.dart'; 18 | import 'time_tick_formatter_impl.dart' 19 | show CalendarField, TimeTickFormatterImpl; 20 | 21 | /// Hour specific tick formatter which will format noon differently. 22 | class HourTickFormatter extends TimeTickFormatterImpl { 23 | late final DateFormat _noonFormat; 24 | 25 | HourTickFormatter( 26 | {required DateTimeFactory dateTimeFactory, 27 | required String? simpleFormat, 28 | required String? transitionFormat, 29 | required String? noonFormat}) 30 | : super( 31 | dateTimeFactory: dateTimeFactory, 32 | simpleFormat: simpleFormat, 33 | transitionFormat: transitionFormat, 34 | transitionField: CalendarField.date) { 35 | _noonFormat = dateTimeFactory.createDateFormat(noonFormat); 36 | } 37 | 38 | @override 39 | String formatSimpleTick(DateTime date) { 40 | return (date.hour == 12) 41 | ? _noonFormat.format(date) 42 | : super.formatSimpleTick(date); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/time/simple_time_tick_formatter.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'time_tick_formatter.dart' show TimeTickFormatter; 17 | 18 | typedef DateTimeFormatterFunction = String Function(DateTime datetime); 19 | 20 | /// Formatter that formats all ticks using a single [DateTimeFormatterFunction]. 21 | class SimpleTimeTickFormatter implements TimeTickFormatter { 22 | DateTimeFormatterFunction formatter; 23 | 24 | SimpleTimeTickFormatter({required this.formatter}); 25 | 26 | @override 27 | String formatFirstTick(DateTime date) => formatter(date); 28 | 29 | @override 30 | String formatSimpleTick(DateTime date) => formatter(date); 31 | 32 | @override 33 | String formatTransitionTick(DateTime date) => formatter(date); 34 | 35 | // Transition fields don't matter here. 36 | @override 37 | bool isTransition(DateTime tickValue, DateTime prevTickValue) => false; 38 | } 39 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/time/time_range_tick_provider.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import '../tick_provider.dart' show BaseTickProvider; 17 | import '../time/date_time_extents.dart' show DateTimeExtents; 18 | 19 | /// Provides ticks for a particular time unit. 20 | /// 21 | /// Used by [AutoAdjustingDateTimeTickProvider]. 22 | abstract class TimeRangeTickProvider extends BaseTickProvider { 23 | /// Returns if this tick provider will produce a sufficient number of ticks 24 | /// for [domainExtents]. 25 | bool providesSufficientTicksForRange(DateTimeExtents domainExtents); 26 | 27 | /// Find the closet step size, from provided step size, in milliseconds. 28 | int getClosestStepSize(int stepSize); 29 | } 30 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/cartesian/axis/time/time_tick_formatter.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | /// Formatter of [DateTime] ticks 17 | abstract class TimeTickFormatter { 18 | /// Format for tick that is the first in a set of ticks. 19 | String formatFirstTick(DateTime date); 20 | 21 | /// Format for a 'simple' tick. 22 | /// 23 | /// Ex. Not a first tick or transition tick. 24 | String formatSimpleTick(DateTime date); 25 | 26 | /// Format for a transitional tick. 27 | String formatTransitionTick(DateTime date); 28 | 29 | /// Returns true if tick is a transitional tick. 30 | bool isTransition(DateTime tickValue, DateTime prevTickValue); 31 | } 32 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/common/behavior/a11y/a11y_node.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:math' show Rectangle; 17 | 18 | typedef OnFocus = void Function(); 19 | 20 | /// Container for accessibility data. 21 | class A11yNode { 22 | /// The bounding box for this node. 23 | final Rectangle boundingBox; 24 | 25 | /// The textual description of this node. 26 | final String label; 27 | 28 | /// Callback when the A11yNode is focused by the native platform 29 | OnFocus? onFocus; 30 | 31 | A11yNode(this.label, this.boundingBox, {this.onFocus}); 32 | } 33 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/common/behavior/selection/selection_trigger.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | enum SelectionTrigger { 17 | hover, 18 | tap, 19 | tapAndDrag, 20 | pressHold, 21 | longPressHold, 22 | } 23 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/common/series_renderer_config.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import '../../common/symbol_renderer.dart'; 17 | import '../../common/typed_registry.dart'; 18 | import 'series_renderer.dart' show SeriesRenderer; 19 | 20 | /// Interface for series renderer configuration. 21 | abstract class SeriesRendererConfig { 22 | /// Stores typed renderer attributes 23 | /// 24 | /// This is useful for storing attributes that is used on the native platform. 25 | /// Such as the SymbolRenderer that is associated with each renderer but is 26 | /// a native builder since legend is built natively. 27 | RendererAttributes get rendererAttributes; 28 | 29 | String? get customRendererId; 30 | 31 | SymbolRenderer? get symbolRenderer; 32 | 33 | SeriesRenderer build(); 34 | } 35 | 36 | class RendererAttributeKey extends TypedKey { 37 | const RendererAttributeKey(String uniqueKey) : super(uniqueKey); 38 | } 39 | 40 | class RendererAttributes extends TypedRegistry {} 41 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/common/unitconverter/identity_converter.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'unit_converter.dart' show UnitConverter; 17 | 18 | /// A No op unit converter. 19 | class IdentityConverter implements UnitConverter { 20 | const IdentityConverter(); 21 | 22 | @override 23 | U convert(U value) => value; 24 | 25 | @override 26 | U invert(U value) => value; 27 | } 28 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/common/unitconverter/unit_converter.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | /// Converts a num value in the 'from' unit to a num value in the 'to' unit. 17 | /// 18 | /// [F] Type of the value in the 'from' units. 19 | /// [T] Type of the value in 'to' units. 20 | abstract class UnitConverter { 21 | /// Converts 'from' unit value to the 'to' unit value. 22 | T convert(F value); 23 | 24 | /// Converts 'to' unit value back to the 'from' unit value. 25 | F invert(T value); 26 | } 27 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/line/line_chart.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:collection' show LinkedHashMap; 17 | 18 | import '../cartesian/axis/axis.dart' show NumericAxis; 19 | import '../cartesian/cartesian_chart.dart' show NumericCartesianChart; 20 | import '../common/series_renderer.dart' show SeriesRenderer; 21 | import '../layout/layout_config.dart' show LayoutConfig; 22 | import '../line/line_renderer.dart' show LineRenderer; 23 | 24 | class LineChart extends NumericCartesianChart { 25 | LineChart( 26 | {bool? vertical, 27 | LayoutConfig? layoutConfig, 28 | NumericAxis? primaryMeasureAxis, 29 | NumericAxis? secondaryMeasureAxis, 30 | LinkedHashMap? disjointMeasureAxes}) 31 | : super( 32 | vertical: vertical, 33 | layoutConfig: layoutConfig, 34 | primaryMeasureAxis: primaryMeasureAxis, 35 | secondaryMeasureAxis: secondaryMeasureAxis, 36 | disjointMeasureAxes: disjointMeasureAxes); 37 | 38 | @override 39 | SeriesRenderer makeDefaultRenderer() { 40 | return LineRenderer()..rendererId = SeriesRenderer.defaultRendererId; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/link/link_chart.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/src/chart/common/base_chart.dart'; 17 | import 'package:charts_common/src/chart/common/datum_details.dart'; 18 | import 'package:charts_common/src/chart/common/selection_model/selection_model.dart'; 19 | import 'package:charts_common/src/chart/common/series_renderer.dart'; 20 | import 'package:charts_common/src/chart/layout/layout_config.dart'; 21 | 22 | import 'package:charts_common/src/chart/link/link_renderer.dart'; 23 | 24 | class LinkChart extends BaseChart { 25 | LinkChart({LayoutConfig? layoutConfig}) 26 | : super(layoutConfig: layoutConfig ?? LayoutConfig()); 27 | 28 | /// Uses LinkRenderer as the default renderer. 29 | @override 30 | SeriesRenderer makeDefaultRenderer() { 31 | return LinkRenderer()..rendererId = SeriesRenderer.defaultRendererId; 32 | } 33 | 34 | /// Returns a list of datum details from the selection model of [type]. 35 | @override 36 | List> getDatumDetails(SelectionModelType type) { 37 | return >[]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/link/link_renderer_config.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/src/chart/common/series_renderer_config.dart'; 17 | import 'package:charts_common/src/chart/layout/layout_view.dart'; 18 | import 'package:charts_common/src/common/symbol_renderer.dart'; 19 | 20 | import 'link_renderer.dart'; 21 | 22 | /// Configuration for a [SankeyRenderer]. 23 | class LinkRendererConfig extends LayoutViewConfig 24 | implements SeriesRendererConfig { 25 | @override 26 | final String? customRendererId; 27 | 28 | @override 29 | final SymbolRenderer symbolRenderer; 30 | 31 | @override 32 | final rendererAttributes = RendererAttributes(); 33 | 34 | /// The order to paint this renderer on the canvas. 35 | final int layoutPaintOrder; 36 | 37 | LinkRendererConfig( 38 | {this.customRendererId, 39 | this.layoutPaintOrder = LayoutViewPaintOrder.bar, 40 | SymbolRenderer? symbolRenderer}) 41 | : symbolRenderer = symbolRenderer ?? RectSymbolRenderer(); 42 | 43 | @override 44 | LinkRenderer build() { 45 | return LinkRenderer(config: this, rendererId: customRendererId); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/pie/arc_renderer_decorator.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:math' show Rectangle; 17 | 18 | import '../../common/graphics_factory.dart' show GraphicsFactory; 19 | import '../common/chart_canvas.dart' show ChartCanvas; 20 | import 'arc_renderer_element.dart' show ArcRendererElementList; 21 | 22 | /// Decorates arcs after the arcs have already been painted. 23 | abstract class ArcRendererDecorator { 24 | const ArcRendererDecorator(); 25 | 26 | /// Configures whether the decorator should be rendered on top of or below 27 | /// series data elements. 28 | bool get renderAbove; 29 | 30 | void decorate(List> arcElementsList, 31 | ChartCanvas canvas, GraphicsFactory graphicsFactory, 32 | {required Rectangle drawBounds, 33 | required double animationPercent, 34 | bool rtl = false}); 35 | } 36 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/sankey/sankey_chart.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/src/chart/common/base_chart.dart'; 17 | import 'package:charts_common/src/chart/common/datum_details.dart'; 18 | import 'package:charts_common/src/chart/common/selection_model/selection_model.dart'; 19 | import 'package:charts_common/src/chart/common/series_renderer.dart'; 20 | import 'package:charts_common/src/chart/layout/layout_config.dart'; 21 | 22 | import 'package:charts_common/src/chart/sankey/sankey_renderer.dart'; 23 | 24 | class SankeyChart extends BaseChart { 25 | SankeyChart({LayoutConfig? layoutConfig}) 26 | : super(layoutConfig: layoutConfig ?? LayoutConfig()); 27 | 28 | /// Uses SankeyRenderer as the default renderer. 29 | @override 30 | SeriesRenderer makeDefaultRenderer() { 31 | return SankeyRenderer()..rendererId = SeriesRenderer.defaultRendererId; 32 | } 33 | 34 | /// Returns a list of datum details from the selection model of [type]. 35 | @override 36 | List> getDatumDetails(SelectionModelType type) { 37 | return >[]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/sankey/sankey_renderer_config.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/src/chart/common/series_renderer_config.dart'; 17 | import 'package:charts_common/src/chart/layout/layout_view.dart'; 18 | import 'package:charts_common/src/common/symbol_renderer.dart'; 19 | 20 | import 'sankey_renderer.dart'; 21 | 22 | /// Configuration for a [SankeyRenderer]. 23 | class SankeyRendererConfig extends LayoutViewConfig 24 | implements SeriesRendererConfig { 25 | @override 26 | final String? customRendererId; 27 | 28 | @override 29 | final SymbolRenderer symbolRenderer; 30 | 31 | @override 32 | final rendererAttributes = RendererAttributes(); 33 | 34 | /// The order to paint this renderer on the canvas. 35 | final int layoutPaintOrder; 36 | 37 | SankeyRendererConfig( 38 | {this.customRendererId, 39 | this.layoutPaintOrder = LayoutViewPaintOrder.sankey, 40 | SymbolRenderer? symbolRenderer}) 41 | : symbolRenderer = symbolRenderer ?? RectSymbolRenderer(); 42 | 43 | @override 44 | SankeyRenderer build() { 45 | return SankeyRenderer(config: this, rendererId: customRendererId); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/scatter_plot/point_renderer_decorator.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:math' show Rectangle; 17 | 18 | import '../../common/graphics_factory.dart' show GraphicsFactory; 19 | import '../common/chart_canvas.dart' show ChartCanvas; 20 | import 'point_renderer.dart' show PointRendererElement; 21 | 22 | /// Decorates points after the points have already been painted. 23 | abstract class PointRendererDecorator { 24 | const PointRendererDecorator(); 25 | 26 | /// Configures whether the decorator should be rendered on top of or below 27 | /// series data elements. 28 | bool get renderAbove; 29 | 30 | void decorate(PointRendererElement pointElement, ChartCanvas canvas, 31 | GraphicsFactory graphicsFactory, 32 | {required Rectangle drawBounds, 33 | required double animationPercent, 34 | bool rtl = false}); 35 | } 36 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/treemap/dice_treemap_renderer.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/src/data/tree.dart'; 17 | 18 | import 'base_treemap_renderer.dart'; 19 | import 'treemap_renderer_config.dart'; 20 | 21 | /// A treemap renderer that renders a treemap with dice layout. 22 | class DiceTreeMapRenderer extends BaseTreeMapRenderer { 23 | DiceTreeMapRenderer({String? rendererId, TreeMapRendererConfig? config}) 24 | : super( 25 | config: 26 | config ?? TreeMapRendererConfig(tileType: TreeMapTileType.dice), 27 | rendererId: rendererId ?? BaseTreeMapRenderer.defaultRendererId); 28 | 29 | /// Uses dicing as the tiling algorithm for this tree map. 30 | @override 31 | void tile(TreeNode node) { 32 | final children = node.children; 33 | if (children.isNotEmpty) { 34 | final rect = availableLayoutBoundingRect(node); 35 | final measure = measureForTreeNode(node); 36 | final scaleFactor = measure == 0 ? 0 : areaForRectangle(rect) / measure; 37 | scaleArea(children, scaleFactor); 38 | position(children, rect, rect.height, areaForRectangle(rect)); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/treemap/slice_dice_treemap_renderer.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/src/data/tree.dart'; 17 | 18 | import 'base_treemap_renderer.dart'; 19 | import 'treemap_renderer_config.dart'; 20 | 21 | /// A treemap renderer that renders a treemap with slice-and-dice layout. 22 | class SliceDiceTreeMapRenderer extends BaseTreeMapRenderer { 23 | SliceDiceTreeMapRenderer( 24 | {String? rendererId, TreeMapRendererConfig? config}) 25 | : super( 26 | config: config ?? 27 | TreeMapRendererConfig(tileType: TreeMapTileType.sliceDice), 28 | rendererId: rendererId ?? BaseTreeMapRenderer.defaultRendererId); 29 | 30 | /// Uses slice-and-dice as the tiling algorithm for this tree map. 31 | @override 32 | void tile(TreeNode node) { 33 | final children = node.children; 34 | if (children.isNotEmpty) { 35 | final rect = availableLayoutBoundingRect(node); 36 | final measure = measureForTreeNode(node); 37 | final scaleFactor = measure == 0 ? 0 : areaForRectangle(rect) / measure; 38 | scaleArea(children, scaleFactor); 39 | position(children, rect, node.depth & 1 == 1 ? rect.height : rect.width, 40 | areaForRectangle(rect)); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/treemap/slice_treemap_renderer.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/src/data/tree.dart'; 17 | 18 | import 'base_treemap_renderer.dart'; 19 | import 'treemap_renderer_config.dart'; 20 | 21 | /// A treemap renderer that renders a treemap with slice layout. 22 | class SliceTreeMapRenderer extends BaseTreeMapRenderer { 23 | SliceTreeMapRenderer({String? rendererId, TreeMapRendererConfig? config}) 24 | : super( 25 | config: config ?? 26 | TreeMapRendererConfig(tileType: TreeMapTileType.slice), 27 | rendererId: rendererId ?? BaseTreeMapRenderer.defaultRendererId); 28 | 29 | /// Uses slicing as the tiling algorithm for this tree map. 30 | @override 31 | void tile(TreeNode node) { 32 | final children = node.children; 33 | if (children.isNotEmpty) { 34 | final rect = availableLayoutBoundingRect(node); 35 | final measure = measureForTreeNode(node); 36 | final scaleFactor = measure == 0 ? 0 : areaForRectangle(rect) / measure; 37 | scaleArea(children, scaleFactor); 38 | position(children, rect, rect.width, areaForRectangle(rect)); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /charts_common/lib/src/chart/treemap/treemap_renderer_decorator.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:math' show Rectangle; 17 | 18 | import 'package:charts_common/src/chart/common/chart_canvas.dart'; 19 | import 'package:charts_common/src/common/graphics_factory.dart'; 20 | 21 | import 'treemap_renderer_element.dart'; 22 | 23 | /// Decorator that gets rendered after [TreeMapRendererElement]s are rendered. 24 | abstract class TreeMapRendererDecorator { 25 | const TreeMapRendererDecorator(); 26 | 27 | /// Paints decorator on top of [rendererElement]. 28 | void decorate(TreeMapRendererElement rendererElement, ChartCanvas canvas, 29 | GraphicsFactory graphicsFactory, 30 | {required Rectangle drawBounds, 31 | required double animationPercent, 32 | bool rtl = false, 33 | bool renderVertically = false, 34 | bool renderMultiline = false}); 35 | } 36 | -------------------------------------------------------------------------------- /charts_common/lib/src/common/graphics_factory.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'line_style.dart' show LineStyle; 17 | import 'text_element.dart' show TextElement; 18 | import 'text_style.dart' show TextStyle; 19 | 20 | /// Interface to native platform graphics functions. 21 | abstract class GraphicsFactory { 22 | LineStyle createLinePaint(); 23 | 24 | /// Returns a [TextStyle] object. 25 | TextStyle createTextPaint(); 26 | 27 | /// Returns a text element from [text]. 28 | TextElement createTextElement(String text); 29 | } 30 | -------------------------------------------------------------------------------- /charts_common/lib/src/common/line_style.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'paint_style.dart' show PaintStyle; 17 | 18 | abstract class LineStyle extends PaintStyle { 19 | List? get dashPattern; 20 | set dashPattern(List? dashPattern); 21 | 22 | int get strokeWidth; 23 | set strokeWidth(int strokeWidth); 24 | } 25 | -------------------------------------------------------------------------------- /charts_common/lib/src/common/paint_style.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'color.dart'; 17 | 18 | /// Style properties of a paintable object. 19 | abstract class PaintStyle { 20 | Color? get color; 21 | 22 | set color(Color? value); 23 | } 24 | -------------------------------------------------------------------------------- /charts_common/lib/src/common/performance.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | typedef PerformanceCallback = void Function(String tag); 17 | 18 | class Performance { 19 | static PerformanceCallback time = (_) {}; 20 | static PerformanceCallback timeEnd = (_) {}; 21 | } 22 | -------------------------------------------------------------------------------- /charts_common/lib/src/common/rtl_spec.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | /// Defines the behavior of the chart if it is RTL. 17 | class RTLSpec { 18 | /// Creates [RTLSpec]. If no parameters are specified, the defaults are used. 19 | const RTLSpec({ 20 | this.axisDirection = AxisDirection.reversed, 21 | }); 22 | 23 | /// Direction of the domain axis when the chart container is configured for 24 | /// RTL mode. 25 | final AxisDirection axisDirection; 26 | } 27 | 28 | /// Direction of the domain axis when the chart container is configured for 29 | /// RTL mode. 30 | /// 31 | /// [normal] Vertically rendered charts will have the primary measure axis on 32 | /// the left and secondary measure axis on the right. Domain axis is on the left 33 | /// and the domain output range starts from the left and grows to the right. 34 | /// Horizontally rendered charts will have the primary measure axis on the 35 | /// bottom and secondary measure axis on the right. Measure output range starts 36 | /// from the left and grows to the right. 37 | /// 38 | /// [reversed] Vertically rendered charts will have the primary measure axis on 39 | /// the right and secondary measure axis on the left. Domain axis is on the 40 | /// right and domain values grows from the right to the left. Horizontally 41 | /// rendered charts will have the primary measure axis on the top and secondary 42 | /// measure axis on the left. Measure output range is flipped and grows from the 43 | /// right to the left. 44 | enum AxisDirection { 45 | normal, 46 | reversed, 47 | } 48 | -------------------------------------------------------------------------------- /charts_common/lib/src/common/style/style_factory.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'material_style.dart' show MaterialStyle; 17 | import 'style.dart' show Style; 18 | 19 | class StyleFactory { 20 | static final StyleFactory _styleFactory = StyleFactory._internal(); 21 | 22 | Style _style = const MaterialStyle(); 23 | 24 | /// The [Style] that is used for all the charts in this application. 25 | static Style get style => _styleFactory._style; 26 | 27 | static set style(Style value) { 28 | _styleFactory._style = value; 29 | } 30 | 31 | StyleFactory._internal(); 32 | } 33 | -------------------------------------------------------------------------------- /charts_common/lib/src/common/text_measurement.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | /// A measurement result for rendering text. 17 | class TextMeasurement { 18 | /// Rendered width of the text. 19 | final double horizontalSliceWidth; 20 | 21 | /// Vertical slice is likely based off the rendered text. 22 | /// 23 | /// This means that 'mo' and 'My' will have different heights so do not use 24 | /// this for centering vertical text. 25 | final double verticalSliceWidth; 26 | 27 | /// Baseline of the text for text vertical alignment. 28 | final double? baseline; 29 | 30 | TextMeasurement({ 31 | required this.horizontalSliceWidth, 32 | required this.verticalSliceWidth, 33 | this.baseline, 34 | }); 35 | } 36 | -------------------------------------------------------------------------------- /charts_common/lib/src/common/text_style.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'paint_style.dart' show PaintStyle; 17 | 18 | /// Paint properties of a text. 19 | abstract class TextStyle extends PaintStyle { 20 | int? get fontSize; 21 | set fontSize(int? value); 22 | 23 | String? get fontFamily; 24 | set fontFamily(String? fontFamily); 25 | 26 | double? get lineHeight; 27 | set lineHeight(double? value); 28 | 29 | String? get fontWeight; 30 | set fontWeight(String? value); 31 | } 32 | -------------------------------------------------------------------------------- /charts_common/lib/src/common/typed_registry.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | class TypedRegistry { 17 | final _registry = , Object?>{}; 18 | 19 | R? getAttr(TypedKey key) { 20 | return _registry[key] as R?; 21 | } 22 | 23 | void setAttr(TypedKey key, R value) { 24 | _registry[key] = value; 25 | } 26 | 27 | void mergeFrom(TypedRegistry other) { 28 | _registry.addAll(other._registry); 29 | } 30 | } 31 | 32 | class TypedKey { 33 | final String uniqueKey; 34 | const TypedKey(this.uniqueKey); 35 | 36 | @override 37 | int get hashCode => uniqueKey.hashCode; 38 | 39 | @override 40 | bool operator ==(Object other) => 41 | other is TypedKey && uniqueKey == other.uniqueKey; 42 | } 43 | -------------------------------------------------------------------------------- /charts_common/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: charts_common 2 | version: 0.12.0 3 | description: A common library for charting packages. 4 | homepage: https://github.com/google/charts 5 | 6 | environment: 7 | sdk: '>=2.12.0 <3.0.0' 8 | 9 | dependencies: 10 | collection: ^1.14.5 11 | intl: ">=0.15.2 < 0.18.0" 12 | logging: ^1.0.2 13 | meta: ^1.1.1 14 | vector_math: ^2.0.8 15 | 16 | dev_dependencies: 17 | mockito: ^5.0.0 18 | test: ^1.5.3 19 | -------------------------------------------------------------------------------- /charts_common/test/chart/cartesian/axis/time/simple_date_time_factory.dart: -------------------------------------------------------------------------------- 1 | // @dart=2.9 2 | 3 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 4 | // for details. 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | import 'package:charts_common/src/common/date_time_factory.dart'; 19 | import 'package:intl/intl.dart' show DateFormat; 20 | 21 | /// Returns DateTime for testing. 22 | class SimpleDateTimeFactory implements DateTimeFactory { 23 | const SimpleDateTimeFactory(); 24 | 25 | @override 26 | DateTime createDateTimeFromMilliSecondsSinceEpoch( 27 | int millisecondsSinceEpoch) => 28 | DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch); 29 | 30 | @override 31 | DateTime createDateTime(int year, 32 | [int month = 1, 33 | int day = 1, 34 | int hour = 0, 35 | int minute = 0, 36 | int second = 0, 37 | int millisecond = 0, 38 | int microsecond = 0]) => 39 | DateTime( 40 | year, month, day, hour, minute, second, millisecond, microsecond); 41 | 42 | @override 43 | DateFormat createDateFormat(String pattern) => DateFormat(pattern); 44 | } 45 | -------------------------------------------------------------------------------- /charts_common/test/chart/layout/layout_manager_impl_test.dart: -------------------------------------------------------------------------------- 1 | // @dart=2.9 2 | 3 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 4 | // for details. 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | import 'package:charts_common/src/chart/layout/layout_config.dart'; 19 | import 'package:charts_common/src/chart/layout/layout_manager_impl.dart'; 20 | 21 | import 'package:test/test.dart'; 22 | 23 | void main() { 24 | test('default layout', () { 25 | var layout = LayoutManagerImpl(); 26 | layout.measure(400, 300); 27 | 28 | expect(layout.marginTop, equals(0)); 29 | expect(layout.marginRight, equals(0)); 30 | expect(layout.marginBottom, equals(0)); 31 | expect(layout.marginLeft, equals(0)); 32 | }); 33 | 34 | test('all fixed margin', () { 35 | var layout = LayoutManagerImpl( 36 | config: LayoutConfig( 37 | topSpec: MarginSpec.fixedPixel(12), 38 | rightSpec: MarginSpec.fixedPixel(11), 39 | bottomSpec: MarginSpec.fixedPixel(10), 40 | leftSpec: MarginSpec.fixedPixel(9), 41 | ), 42 | ); 43 | layout.measure(400, 300); 44 | 45 | expect(layout.marginTop, equals(12)); 46 | expect(layout.marginRight, equals(11)); 47 | expect(layout.marginBottom, equals(10)); 48 | expect(layout.marginLeft, equals(9)); 49 | }); 50 | } 51 | -------------------------------------------------------------------------------- /charts_flutter/README.md: -------------------------------------------------------------------------------- 1 | # Flutter Charting library 2 | 3 | [![pub package](https://img.shields.io/pub/v/charts_flutter.svg)](https://pub.dartlang.org/packages/charts_flutter) 4 | 5 | Material Design data visualization library written natively in Dart. 6 | 7 | ## Supported charts 8 | 9 | See the [online gallery](https://google.github.io/charts/flutter/gallery.html). 10 | 11 | ## Using the library 12 | 13 | The `/example/` folder inside `charts_flutter` in the [GitHub repo](https://github.com/google/charts) 14 | contains a full Flutter app with many demo examples. 15 | 16 | ## Development 17 | This project is developed internally at Google and published for external 18 | consumption, external contributions unfortunately cannot be taken at this time. 19 | -------------------------------------------------------------------------------- /charts_flutter/charts_flutter.gwsq: -------------------------------------------------------------------------------- 1 | send_cls_to('dart-charts-team+reviews'); 2 | send_cls_to('dart-charts-team'); 3 | 4 | define Main { 5 | reassign_to_list(from_owners_file('third_party/dart/charts_common/OWNERS')); 6 | } 7 | -------------------------------------------------------------------------------- /charts_flutter/example/android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /charts_flutter/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /charts_flutter/example/android/Android_Charts.xml: -------------------------------------------------------------------------------- 1 | 5 | 8 | -------------------------------------------------------------------------------- /charts_flutter/example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 28 19 | 20 | lintOptions { 21 | disable 'InvalidPackage' 22 | } 23 | 24 | defaultConfig { 25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 26 | applicationId "com.example.examples" 27 | minSdkVersion 16 28 | targetSdkVersion 28 29 | versionCode 1 30 | versionName "1.0" 31 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 32 | } 33 | 34 | buildTypes { 35 | release { 36 | // TODO: Add your own signing config for the release build. 37 | // Signing with the debug keys for now, so `flutter run --release` works. 38 | signingConfig signingConfigs.debug 39 | } 40 | } 41 | } 42 | 43 | flutter { 44 | source '../..' 45 | } 46 | 47 | dependencies { 48 | testImplementation 'junit:junit:4.12' 49 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 50 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 51 | } 52 | -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/java/com/example/examples/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.examples; 2 | 3 | import android.os.Bundle; 4 | 5 | import io.flutter.app.FlutterActivity; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | /** 9 | * FlutterActivity 10 | */ 11 | public class MainActivity extends FlutterActivity { 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | GeneratedPluginRegistrant.registerWith(this); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import io.flutter.plugin.common.PluginRegistry; 4 | 5 | /** 6 | * Generated file. Do not edit. 7 | */ 8 | public final class GeneratedPluginRegistrant { 9 | public static void registerWith(PluginRegistry registry) { 10 | if (alreadyRegisteredWith(registry)) { 11 | return; 12 | } 13 | } 14 | 15 | private static boolean alreadyRegisteredWith(PluginRegistry registry) { 16 | final String key = GeneratedPluginRegistrant.class.getCanonicalName(); 17 | if (registry.hasPlugin(key)) { 18 | return true; 19 | } 20 | registry.registrarFor(key); 21 | return false; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /charts_flutter/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /charts_flutter/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.3' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /charts_flutter/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /charts_flutter/example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /charts_flutter/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Feb 19 15:38:12 AWST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /charts_flutter/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /charts_flutter/example/examples.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /charts_flutter/example/examples_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | UIRequiredDeviceCapabilities 24 | 25 | arm64 26 | 27 | MinimumOSVersion 28 | 8.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Ios_Charts.xml: -------------------------------------------------------------------------------- 1 | 5 | 8 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | @interface AppDelegate : UIResponder 19 | 20 | @property(strong, nonatomic) UIWindow *window; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-Small@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-Small@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-Small-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-Small-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-60@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-60@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "29x29", 41 | "idiom" : "ipad", 42 | "filename" : "Icon-Small.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "Icon-Small@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "40x40", 53 | "idiom" : "ipad", 54 | "filename" : "Icon-Small-40.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-Small-40@2x.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "76x76", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-76.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "76x76", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-76@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "83.5x83.5", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-83.5@2x.png", 79 | "scale" : "2x" 80 | } 81 | ] 82 | } -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/charts_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | Charts Flutter Gallery 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | arm64 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /charts_flutter/example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import 18 | #import "AppDelegate.h" 19 | 20 | int main(int argc, char* argv[]) { 21 | @autoreleasepool { 22 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /charts_flutter/example/lib/a11y/a11y_gallery.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | import 'package:flutter/material.dart'; 16 | import '../gallery_scaffold.dart'; 17 | import 'domain_a11y_explore_bar_chart.dart'; 18 | 19 | List buildGallery() { 20 | return [ 21 | new GalleryScaffold( 22 | listTileIcon: new Icon(Icons.accessibility), 23 | title: 'Screen reader enabled bar chart', 24 | subtitle: 'Requires TalkBack or Voiceover turned on to work. ' 25 | 'Bar chart with domain selection explore mode behavior.', 26 | childBuilder: () => new DomainA11yExploreBarChart.withRandomData(), 27 | ), 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /charts_flutter/example/lib/app_config.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:flutter/material.dart'; 17 | 18 | /// A particular configuration of the app. 19 | class AppConfig { 20 | final String appName; 21 | final String appLink; 22 | final ThemeData theme; 23 | final bool showPerformanceOverlay; 24 | 25 | AppConfig({ 26 | required this.appName, 27 | required this.appLink, 28 | required this.theme, 29 | required this.showPerformanceOverlay, 30 | }); 31 | } 32 | 33 | /// The default configuration of the app. 34 | AppConfig get defaultConfig { 35 | return new AppConfig( 36 | appName: 'Charts Gallery', 37 | appLink: '', 38 | theme: new ThemeData( 39 | brightness: Brightness.light, 40 | primarySwatch: Colors.lightBlue, 41 | ), 42 | showPerformanceOverlay: false, 43 | ); 44 | } 45 | -------------------------------------------------------------------------------- /charts_flutter/example/lib/drawer.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:flutter/material.dart'; 17 | 18 | /// A menu drawer supporting toggling theme and performance overlay. 19 | class GalleryDrawer extends StatelessWidget { 20 | final bool showPerformanceOverlay; 21 | final ValueChanged onShowPerformanceOverlayChanged; 22 | 23 | GalleryDrawer( 24 | {Key? key, 25 | this.showPerformanceOverlay = false, 26 | required this.onShowPerformanceOverlayChanged}) 27 | : super(key: key); 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return new Drawer( 32 | child: new ListView(children: [ 33 | // Performance overlay toggle. 34 | new ListTile( 35 | leading: new Icon(Icons.assessment), 36 | title: new Text('Performance Overlay'), 37 | onTap: () { 38 | onShowPerformanceOverlayChanged(!showPerformanceOverlay); 39 | }, 40 | selected: showPerformanceOverlay, 41 | trailing: new Checkbox( 42 | value: showPerformanceOverlay, 43 | onChanged: (bool? value) { 44 | onShowPerformanceOverlayChanged(!showPerformanceOverlay); 45 | }, 46 | ), 47 | ), 48 | ]), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /charts_flutter/example/lib/i18n/i18n_gallery.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:flutter/material.dart'; 17 | import '../gallery_scaffold.dart'; 18 | import 'rtl_bar_chart.dart'; 19 | import 'rtl_line_chart.dart'; 20 | import 'rtl_line_segments.dart'; 21 | import 'rtl_series_legend.dart'; 22 | 23 | List buildGallery() { 24 | return [ 25 | new GalleryScaffold( 26 | listTileIcon: new Icon(Icons.flag), 27 | title: 'RTL Bar Chart', 28 | subtitle: 'Simple bar chart in RTL', 29 | childBuilder: () => new RTLBarChart.withRandomData(), 30 | ), 31 | new GalleryScaffold( 32 | listTileIcon: new Icon(Icons.flag), 33 | title: 'RTL Line Chart', 34 | subtitle: 'Simple line chart in RTL', 35 | childBuilder: () => new RTLLineChart.withRandomData(), 36 | ), 37 | new GalleryScaffold( 38 | listTileIcon: new Icon(Icons.flag), 39 | title: 'RTL Line Segments', 40 | subtitle: 'Stacked area chart with style segments in RTL', 41 | childBuilder: () => new RTLLineSegments.withRandomData(), 42 | ), 43 | new GalleryScaffold( 44 | listTileIcon: new Icon(Icons.flag), 45 | title: 'RTL Series Legend', 46 | subtitle: 'Series legend in RTL', 47 | childBuilder: () => new RTLSeriesLegend.withRandomData(), 48 | ), 49 | ]; 50 | } 51 | -------------------------------------------------------------------------------- /charts_flutter/example/lib/main.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:flutter/material.dart'; 17 | import 'app_config.dart'; 18 | import 'home.dart'; 19 | 20 | /// The main gallery app widget. 21 | class GalleryApp extends StatefulWidget { 22 | GalleryApp({Key? key}) : super(key: key); 23 | 24 | @override 25 | GalleryAppState createState() => new GalleryAppState(); 26 | } 27 | 28 | /// The main gallery app state. 29 | /// 30 | /// Controls performance overlay, and instantiates a [Home] widget. 31 | class GalleryAppState extends State { 32 | // Initialize app settings from the default configuration. 33 | bool _showPerformanceOverlay = defaultConfig.showPerformanceOverlay; 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return new MaterialApp( 38 | title: defaultConfig.appName, 39 | theme: defaultConfig.theme, 40 | showPerformanceOverlay: _showPerformanceOverlay, 41 | home: new Home( 42 | showPerformanceOverlay: _showPerformanceOverlay, 43 | onShowPerformanceOverlayChanged: (bool value) { 44 | setState(() { 45 | _showPerformanceOverlay = value; 46 | }); 47 | }, 48 | )); 49 | } 50 | } 51 | 52 | void main() { 53 | runApp(new GalleryApp()); 54 | } 55 | -------------------------------------------------------------------------------- /charts_flutter/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: Charts-Flutter Demo 3 | environment: 4 | sdk: '>=2.12.0 <3.0.0' 5 | flutter: '>=2.5.0' 6 | 7 | dependencies: 8 | charts_flutter: 9 | path: ../ 10 | cupertino_icons: ^0.1.0 11 | flutter: 12 | sdk: flutter 13 | flutter_test: 14 | sdk: flutter 15 | meta: ^1.1.1 16 | intl: ">=0.15.2 < 0.18.0" 17 | flutter: 18 | uses-material-design: true 19 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/behaviors/domain_highlighter.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/common.dart' as common 17 | show ChartBehavior, DomainHighlighter, SelectionModelType; 18 | 19 | import 'package:meta/meta.dart' show immutable; 20 | 21 | import 'chart_behavior.dart' show ChartBehavior, GestureType; 22 | 23 | /// Chart behavior that monitors the specified [SelectionModel] and darkens the 24 | /// color for selected data. 25 | /// 26 | /// This is typically used for bars and pies to highlight segments. 27 | /// 28 | /// It is used in combination with SelectNearest to update the selection model 29 | /// and expand selection out to the domain value. 30 | @immutable 31 | class DomainHighlighter extends ChartBehavior { 32 | final desiredGestures = new Set(); 33 | 34 | final common.SelectionModelType selectionModelType; 35 | 36 | DomainHighlighter([this.selectionModelType = common.SelectionModelType.info]); 37 | 38 | @override 39 | common.DomainHighlighter createCommonBehavior() => 40 | new common.DomainHighlighter(selectionModelType); 41 | 42 | @override 43 | void updateCommonBehavior(common.ChartBehavior commonBehavior) {} 44 | 45 | @override 46 | String get role => 'domainHighlight-${selectionModelType.toString()}'; 47 | 48 | @override 49 | bool operator ==(Object o) => 50 | o is DomainHighlighter && selectionModelType == o.selectionModelType; 51 | 52 | @override 53 | int get hashCode => selectionModelType.hashCode; 54 | } 55 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/behaviors/legend/legend.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/common.dart' show LegendEntry, LegendTapHandling; 17 | 18 | abstract class TappableLegend { 19 | /// Delegates handling of legend entry clicks according to the configured 20 | /// [LegendTapHandling] strategy. 21 | onLegendEntryTapUp(LegendEntry detail); 22 | } 23 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/behaviors/sliding_viewport.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/common.dart' as common 17 | show ChartBehavior, SelectionModelType, SlidingViewport; 18 | 19 | import 'package:meta/meta.dart' show immutable; 20 | 21 | import 'chart_behavior.dart' show ChartBehavior, GestureType; 22 | 23 | /// Chart behavior that centers the viewport on the selected domain. 24 | /// 25 | /// It is used in combination with SelectNearest to update the selection model 26 | /// and notify this behavior to update the viewport on selection change. 27 | /// 28 | /// This behavior can only be used on [CartesianChart]. 29 | @immutable 30 | class SlidingViewport extends ChartBehavior { 31 | final desiredGestures = new Set(); 32 | 33 | final common.SelectionModelType selectionModelType; 34 | 35 | SlidingViewport([this.selectionModelType = common.SelectionModelType.info]); 36 | 37 | @override 38 | common.SlidingViewport createCommonBehavior() => 39 | new common.SlidingViewport(selectionModelType); 40 | 41 | @override 42 | void updateCommonBehavior(common.ChartBehavior commonBehavior) {} 43 | 44 | @override 45 | String get role => 'slidingViewport-${selectionModelType.toString()}'; 46 | 47 | @override 48 | bool operator ==(Object o) => 49 | o is SlidingViewport && selectionModelType == o.selectionModelType; 50 | 51 | @override 52 | int get hashCode => selectionModelType.hashCode; 53 | } 54 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/canvas/point_painter.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:math' show Point; 17 | import 'package:flutter/material.dart'; 18 | import 'package:charts_common/common.dart' as common show Color; 19 | 20 | /// Draws a simple point. 21 | /// 22 | /// TODO: Support for more shapes than circles? 23 | class PointPainter { 24 | static void draw( 25 | {required Canvas canvas, 26 | required Paint paint, 27 | required Point point, 28 | required double radius, 29 | common.Color? fill, 30 | common.Color? stroke, 31 | double? strokeWidthPx}) { 32 | if (point == null) { 33 | return; 34 | } 35 | 36 | if (fill != null) { 37 | paint.color = new Color.fromARGB(fill.a, fill.r, fill.g, fill.b); 38 | paint.style = PaintingStyle.fill; 39 | 40 | canvas.drawCircle( 41 | new Offset(point.x.toDouble(), point.y.toDouble()), radius, paint); 42 | } 43 | 44 | // [Canvas.drawCircle] does not support drawing a circle with both a fill 45 | // and a stroke at this time. Use a separate circle for the stroke. 46 | if (stroke != null && strokeWidthPx != null && strokeWidthPx > 0.0) { 47 | paint.color = new Color.fromARGB(stroke.a, stroke.r, stroke.g, stroke.b); 48 | paint.strokeWidth = strokeWidthPx; 49 | paint.strokeJoin = StrokeJoin.bevel; 50 | paint.style = PaintingStyle.stroke; 51 | 52 | canvas.drawCircle( 53 | new Offset(point.x.toDouble(), point.y.toDouble()), radius, paint); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/chart_state.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | abstract class ChartState { 17 | void setAnimation(Duration transition); 18 | 19 | /// Request to the native platform to rebuild the chart. 20 | void requestRebuild(); 21 | 22 | /// Informs the chart that the configuration has changed. 23 | /// 24 | /// This flag is set by checks that detect if a configuration has changed, 25 | /// such as behaviors, axis, and renderers. 26 | /// 27 | /// This flag is read on chart rebuild, if chart is marked as dirty, then the 28 | /// chart will call a base chart draw. 29 | void markChartDirty(); 30 | 31 | /// Reset the chart dirty flag. 32 | void resetChartDirtyFlag(); 33 | 34 | /// Gets if the chart is dirty. 35 | bool get chartIsDirty; 36 | } 37 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/line_style.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/common.dart' as common show Color, LineStyle; 17 | 18 | class LineStyle implements common.LineStyle { 19 | @override 20 | common.Color? color; 21 | 22 | @override 23 | List? dashPattern; 24 | 25 | @override 26 | int strokeWidth; 27 | 28 | LineStyle({this.strokeWidth = 0}); 29 | } 30 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/pie_chart.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/common.dart' as common 17 | show ArcRendererConfig, PieChart, RTLSpec, Series; 18 | import 'behaviors/chart_behavior.dart' show ChartBehavior; 19 | import 'base_chart.dart' show BaseChart, LayoutConfig; 20 | import 'base_chart_state.dart' show BaseChartState; 21 | import 'selection_model_config.dart' show SelectionModelConfig; 22 | 23 | class PieChart extends BaseChart { 24 | PieChart( 25 | List> seriesList, { 26 | bool? animate, 27 | Duration? animationDuration, 28 | common.ArcRendererConfig? defaultRenderer, 29 | List>? behaviors, 30 | List>? selectionModels, 31 | common.RTLSpec? rtlSpec, 32 | LayoutConfig? layoutConfig, 33 | bool defaultInteractions = true, 34 | }) : super( 35 | seriesList, 36 | animate: animate, 37 | animationDuration: animationDuration, 38 | defaultRenderer: defaultRenderer, 39 | behaviors: behaviors, 40 | selectionModels: selectionModels, 41 | rtlSpec: rtlSpec, 42 | layoutConfig: layoutConfig, 43 | defaultInteractions: defaultInteractions, 44 | ); 45 | 46 | @override 47 | common.PieChart createCommonChart(BaseChartState chartState) => 48 | new common.PieChart(layoutConfig: layoutConfig?.commonLayoutConfig); 49 | } 50 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/selection_model_config.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:meta/meta.dart' show immutable; 17 | 18 | import 'package:charts_common/common.dart' as common; 19 | 20 | @immutable 21 | class SelectionModelConfig { 22 | final common.SelectionModelType type; 23 | 24 | /// Listens for change in selection. 25 | final common.SelectionModelListener? changedListener; 26 | 27 | /// Listens anytime update selection is called. 28 | final common.SelectionModelListener? updatedListener; 29 | 30 | SelectionModelConfig( 31 | {this.type = common.SelectionModelType.info, 32 | this.changedListener, 33 | this.updatedListener}); 34 | } 35 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/text_style.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'dart:ui' show hashValues; 17 | import 'package:charts_common/common.dart' as common show Color, TextStyle; 18 | 19 | class TextStyle implements common.TextStyle { 20 | int? fontSize; 21 | String? fontFamily; 22 | common.Color? color; 23 | double? lineHeight; 24 | String? fontWeight; 25 | 26 | @override 27 | bool operator ==(Object other) => 28 | other is TextStyle && 29 | fontSize == other.fontSize && 30 | fontFamily == other.fontFamily && 31 | fontWeight == other.fontWeight && 32 | color == other.color && 33 | lineHeight == other.lineHeight; 34 | 35 | @override 36 | int get hashCode => 37 | hashValues(fontSize, fontFamily, color, lineHeight, fontWeight); 38 | } 39 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/util.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:flutter/rendering.dart' 17 | show 18 | RenderBox, 19 | RenderSemanticsGestureHandler, 20 | RenderPointerListener, 21 | RenderCustomMultiChildLayoutBox; 22 | import 'chart_container.dart' show ChartContainerRenderObject; 23 | 24 | /// Get the [ChartContainerRenderObject] from a [RenderBox]. 25 | /// 26 | /// [RenderBox] is expected to be a [RenderSemanticsGestureHandler] with child 27 | /// of [RenderPointerListener] with child of [ChartContainerRenderObject]. 28 | ChartContainerRenderObject getChartContainerRenderObject(RenderBox box) { 29 | assert(box is RenderCustomMultiChildLayoutBox); 30 | final semanticHandler = (box as RenderCustomMultiChildLayoutBox) 31 | .getChildrenAsList() 32 | .firstWhere((child) => child is RenderSemanticsGestureHandler); 33 | 34 | assert(semanticHandler is RenderSemanticsGestureHandler); 35 | final renderPointerListener = 36 | (semanticHandler as RenderSemanticsGestureHandler).child; 37 | 38 | assert(renderPointerListener is RenderPointerListener); 39 | final chartContainerRenderObject = 40 | (renderPointerListener as RenderPointerListener).child; 41 | 42 | assert(chartContainerRenderObject is ChartContainerRenderObject); 43 | 44 | return chartContainerRenderObject as ChartContainerRenderObject; 45 | } 46 | -------------------------------------------------------------------------------- /charts_flutter/lib/src/util/color.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:charts_common/common.dart' as common show Color; 17 | import 'dart:ui' as ui; 18 | 19 | class ColorUtil { 20 | static ui.Color toDartColor(common.Color color) { 21 | return ui.Color.fromARGB(color.a, color.r, color.g, color.b); 22 | } 23 | 24 | static common.Color fromDartColor(ui.Color color) { 25 | return common.Color( 26 | r: color.red, g: color.green, b: color.blue, a: color.alpha); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /charts_flutter/minimum_os.bzl: -------------------------------------------------------------------------------- 1 | """Minimum OS version definitions""" 2 | 3 | IOS_MINIMUM_OS = "9.0" 4 | -------------------------------------------------------------------------------- /charts_flutter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: charts_flutter 2 | version: 0.12.0 3 | description: Material Design charting library for flutter. 4 | homepage: https://github.com/google/charts 5 | 6 | environment: 7 | sdk: '>=2.12.0 <3.0.0' 8 | flutter: '>=2.5.0' 9 | 10 | dependencies: 11 | # Pointing this to a local path allows for pointing to the latest code 12 | # in Github for open source development. 13 | # 14 | # The pub version of charts_flutter will point to the pub version of charts_common. 15 | # The latest pub version is commented out and shown below as an example. 16 | charts_common: ^0.12.0 17 | # charts_common: 18 | # path: ../charts_common/ 19 | collection: ^1.14.5 20 | flutter: 21 | sdk: flutter 22 | intl: ">=0.15.2 < 0.18.0" 23 | logging: ^1.0.2 24 | meta: ^1.1.1 25 | 26 | 27 | dev_dependencies: 28 | mockito: ^5.0.0 29 | build_runner: ^1.11.0 30 | flutter_test: 31 | sdk: flutter 32 | test: ^1.3.0 33 | -------------------------------------------------------------------------------- /charts_flutter/test/text_element_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the Charts project authors. Please see the AUTHORS file 2 | // for details. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | import 'package:flutter/material.dart' show BuildContext; 17 | import 'package:mockito/mockito.dart'; 18 | import 'package:flutter/widgets.dart' show InheritedWidget; 19 | import 'package:test/test.dart'; 20 | import 'package:charts_flutter/src/graphics_factory.dart'; 21 | import 'package:charts_flutter/src/text_element.dart'; 22 | 23 | // Can't use Mockito annotations with BuildContext yet? Fake it. 24 | class FakeBuildContext extends Fake implements BuildContext { 25 | @override 26 | T? dependOnInheritedWidgetOfExactType( 27 | {Object? aspect}) { 28 | return null; 29 | } 30 | } 31 | 32 | // Gave up trying to figure out how to use mockito for now. 33 | class FakeGraphicsFactoryHelper extends Fake implements GraphicsFactoryHelper { 34 | double textScaleFactor; 35 | 36 | FakeGraphicsFactoryHelper(this.textScaleFactor) {} 37 | 38 | @override 39 | double getTextScaleFactorOf(BuildContext context) => textScaleFactor; 40 | } 41 | 42 | void main() { 43 | test('Text element gets assigned scale factor', () { 44 | final context = FakeBuildContext(); 45 | final helper = FakeGraphicsFactoryHelper(3.0); 46 | final graphicsFactory = new GraphicsFactory(context, helper: helper); 47 | 48 | final textElement = 49 | graphicsFactory.createTextElement('test') as TextElement; 50 | 51 | expect(textElement.text, equals('test')); 52 | expect(textElement.textScaleFactor, equals(3.0)); 53 | }); 54 | } 55 | -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | # This file enables generation of documentation html from markdown locally. 2 | # 3 | # Ruby 2.10 or later is required. 4 | # To install needed dependencies: 5 | # 6 | # gem install bundler 7 | # bundle install --path .bundle 8 | # 9 | # To generate and serve html locally: 10 | # 11 | # bundle exec jekyll serve 12 | # 13 | # -------------------------------------------------------------------------- 14 | source 'https://rubygems.org' 15 | gem 'github-pages', group: :jekyll_plugins 16 | -------------------------------------------------------------------------------- /docs/flutter/example/a11ys/domain_a11y_explore_bar_chart_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/a11ys/domain_a11y_explore_bar_chart_full.png -------------------------------------------------------------------------------- /docs/flutter/example/a11ys/domain_a11y_explore_bar_chart_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/a11ys/domain_a11y_explore_bar_chart_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/bar_secondary_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/bar_secondary_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/bar_secondary_axis_only_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/bar_secondary_axis_only_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/bar_secondary_axis_only_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/bar_secondary_axis_only_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/bar_secondary_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/bar_secondary_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/custom_axis_tick_formatters_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/custom_axis_tick_formatters_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/custom_axis_tick_formatters_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/custom_axis_tick_formatters_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/custom_font_size_and_color_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/custom_font_size_and_color_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/custom_font_size_and_color_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/custom_font_size_and_color_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/custom_measure_tick_count_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/custom_measure_tick_count_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/custom_measure_tick_count_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/custom_measure_tick_count_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/flipped_vertical_axis.md: -------------------------------------------------------------------------------- 1 | # Flipped Vertical Axis Axes Example 2 | 3 | ![](flipped_vertical_axis_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Bar chart example 9 | import 'package:flutter/material.dart'; 10 | import 'package:charts_flutter/flutter.dart' as charts; 11 | 12 | /// Example of flipping the vertical measure axis direction so that larger values render 13 | /// downward instead of the usual rendering up. 14 | /// 15 | /// flipVerticalAxis, when set, flips the vertical axis from its default direction. 16 | /// 17 | /// Note: primary and secondary may flip left and right positioning when 18 | /// RTL.flipAxisLocations is set. 19 | class FlippedVerticalAxis extends StatelessWidget { 20 | final List seriesList; 21 | final bool animate; 22 | 23 | FlippedVerticalAxis(this.seriesList, {this.animate}); 24 | 25 | factory FlippedVerticalAxis.withSampleData() { 26 | return new FlippedVerticalAxis( 27 | _createSampleData(), 28 | // Disable animations for image tests. 29 | animate: false, 30 | ); 31 | } 32 | 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return new charts.BarChart( 37 | seriesList, 38 | animate: animate, 39 | flipVerticalAxis: true, 40 | ); 41 | } 42 | 43 | /// Create series list with multiple series 44 | static List> _createSampleData() { 45 | final raceData = [ 46 | new RunnerRank('Smith', 1), 47 | new RunnerRank('Jones', 2), 48 | new RunnerRank('Brown', 3), 49 | new RunnerRank('Doe', 4), 50 | ]; 51 | 52 | return [ 53 | new charts.Series( 54 | id: 'Race Results', 55 | domainFn: (RunnerRank row, _) => row.name, 56 | measureFn: (RunnerRank row, _) => row.place, 57 | data: raceData), 58 | ]; 59 | } 60 | } 61 | 62 | /// Datum/Row for the chart. 63 | class RunnerRank { 64 | final String name; 65 | final int place; 66 | RunnerRank(this.name, this.place); 67 | } 68 | ``` 69 | -------------------------------------------------------------------------------- /docs/flutter/example/axes/flipped_vertical_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/flipped_vertical_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/flipped_vertical_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/flipped_vertical_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/gridline_dash_pattern_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/gridline_dash_pattern_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/gridline_dash_pattern_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/gridline_dash_pattern_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/hidden_ticks_and_labels_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/hidden_ticks_and_labels_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/hidden_ticks_and_labels_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/hidden_ticks_and_labels_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/horizontal_bar_secondary_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/horizontal_bar_secondary_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/horizontal_bar_secondary_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/horizontal_bar_secondary_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/integer_only_measure_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/integer_only_measure_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/integer_only_measure_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/integer_only_measure_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/line_disjoint_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/line_disjoint_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/line_disjoint_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/line_disjoint_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/measure_axis_label_alignment_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/measure_axis_label_alignment_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/measure_axis_label_alignment_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/measure_axis_label_alignment_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/nonzero_bound_measure_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/nonzero_bound_measure_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/nonzero_bound_measure_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/nonzero_bound_measure_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/numeric_initial_viewport_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/numeric_initial_viewport_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/numeric_initial_viewport_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/numeric_initial_viewport_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/ordinal_initial_viewport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/ordinal_initial_viewport.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/ordinal_initial_viewport_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/ordinal_initial_viewport_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/ordinal_initial_viewport_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/ordinal_initial_viewport_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/short_tick_length_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/short_tick_length_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/short_tick_length_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/short_tick_length_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/statically_provided_ticks_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/statically_provided_ticks_full.png -------------------------------------------------------------------------------- /docs/flutter/example/axes/statically_provided_ticks_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/axes/statically_provided_ticks_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/custom_rounded_bars.md: -------------------------------------------------------------------------------- 1 | # Custom Rounded Bars Bar Chart Example 2 | 3 | ![](custom_rounded_bars_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Bar chart example 9 | import 'package:charts_flutter/flutter.dart' as charts; 10 | import 'package:flutter/material.dart'; 11 | 12 | class CustomRoundedBars extends StatelessWidget { 13 | final List seriesList; 14 | final bool animate; 15 | 16 | CustomRoundedBars(this.seriesList, {this.animate}); 17 | 18 | /// Creates a [BarChart] with custom rounded bars. 19 | factory CustomRoundedBars.withSampleData() { 20 | return new CustomRoundedBars( 21 | _createSampleData(), 22 | // Disable animations for image tests. 23 | animate: false, 24 | ); 25 | } 26 | 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return new charts.BarChart( 31 | seriesList, 32 | animate: animate, 33 | defaultRenderer: new charts.BarRendererConfig( 34 | // By default, bar renderer will draw rounded bars with a constant 35 | // radius of 100. 36 | // To not have any rounded corners, use [NoCornerStrategy] 37 | // To change the radius of the bars, use [ConstCornerStrategy] 38 | cornerStrategy: const charts.ConstCornerStrategy(30)), 39 | ); 40 | } 41 | 42 | /// Create one series with sample hard coded data. 43 | static List> _createSampleData() { 44 | final data = [ 45 | new OrdinalSales('2014', 5), 46 | new OrdinalSales('2015', 25), 47 | new OrdinalSales('2016', 100), 48 | new OrdinalSales('2017', 75), 49 | ]; 50 | 51 | return [ 52 | new charts.Series( 53 | id: 'Sales', 54 | colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, 55 | domainFn: (OrdinalSales sales, _) => sales.year, 56 | measureFn: (OrdinalSales sales, _) => sales.sales, 57 | data: data, 58 | ) 59 | ]; 60 | } 61 | } 62 | 63 | /// Sample ordinal data type. 64 | class OrdinalSales { 65 | final String year; 66 | final int sales; 67 | 68 | OrdinalSales(this.year, this.sales); 69 | } 70 | ``` 71 | -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/custom_rounded_bars_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/custom_rounded_bars_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/custom_rounded_bars_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/custom_rounded_bars_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_fill_color_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_fill_color_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_fill_color_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_fill_color_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_stacked_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_stacked_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_stacked_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_stacked_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_stacked_weight_pattern_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_stacked_weight_pattern_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_stacked_weight_pattern_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_stacked_weight_pattern_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_target_line_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_target_line_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_target_line_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_target_line_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/grouped_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/grouped_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/horizontal.md: -------------------------------------------------------------------------------- 1 | # Horizontal Bar Chart Example 2 | 3 | ![](horizontal_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Horizontal bar chart example 9 | import 'package:charts_flutter/flutter.dart' as charts; 10 | import 'package:flutter/material.dart'; 11 | 12 | class HorizontalBarChart extends StatelessWidget { 13 | final List seriesList; 14 | final bool animate; 15 | 16 | HorizontalBarChart(this.seriesList, {this.animate}); 17 | 18 | /// Creates a [BarChart] with sample data and no transition. 19 | factory HorizontalBarChart.withSampleData() { 20 | return new HorizontalBarChart( 21 | _createSampleData(), 22 | // Disable animations for image tests. 23 | animate: false, 24 | ); 25 | } 26 | 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | // For horizontal bar charts, set the [vertical] flag to false. 31 | return new charts.BarChart( 32 | seriesList, 33 | animate: animate, 34 | vertical: false, 35 | ); 36 | } 37 | 38 | /// Create one series with sample hard coded data. 39 | static List> _createSampleData() { 40 | final data = [ 41 | new OrdinalSales('2014', 5), 42 | new OrdinalSales('2015', 25), 43 | new OrdinalSales('2016', 100), 44 | new OrdinalSales('2017', 75), 45 | ]; 46 | 47 | return [ 48 | new charts.Series( 49 | id: 'Sales', 50 | domainFn: (OrdinalSales sales, _) => sales.year, 51 | measureFn: (OrdinalSales sales, _) => sales.sales, 52 | data: data, 53 | ) 54 | ]; 55 | } 56 | } 57 | 58 | /// Sample ordinal data type. 59 | class OrdinalSales { 60 | final String year; 61 | final int sales; 62 | 63 | OrdinalSales(this.year, this.sales); 64 | } 65 | ``` 66 | -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/horizontal_bar_label_custom_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/horizontal_bar_label_custom_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/horizontal_bar_label_custom_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/horizontal_bar_label_custom_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/horizontal_bar_label_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/horizontal_bar_label_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/horizontal_bar_label_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/horizontal_bar_label_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/horizontal_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/horizontal_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/horizontal_pattern_forward_hatch_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/horizontal_pattern_forward_hatch_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/horizontal_pattern_forward_hatch_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/horizontal_pattern_forward_hatch_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/horizontal_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/horizontal_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/pattern_forward_hatch_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/pattern_forward_hatch_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/pattern_forward_hatch_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/pattern_forward_hatch_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/simple.md: -------------------------------------------------------------------------------- 1 | # Simple Bar Chart Example 2 | 3 | ![](simple_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Bar chart example 9 | import 'package:charts_flutter/flutter.dart' as charts; 10 | import 'package:flutter/material.dart'; 11 | 12 | class SimpleBarChart extends StatelessWidget { 13 | final List seriesList; 14 | final bool animate; 15 | 16 | SimpleBarChart(this.seriesList, {this.animate}); 17 | 18 | /// Creates a [BarChart] with sample data and no transition. 19 | factory SimpleBarChart.withSampleData() { 20 | return new SimpleBarChart( 21 | _createSampleData(), 22 | // Disable animations for image tests. 23 | animate: false, 24 | ); 25 | } 26 | 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return new charts.BarChart( 31 | seriesList, 32 | animate: animate, 33 | ); 34 | } 35 | 36 | /// Create one series with sample hard coded data. 37 | static List> _createSampleData() { 38 | final data = [ 39 | new OrdinalSales('2014', 5), 40 | new OrdinalSales('2015', 25), 41 | new OrdinalSales('2016', 100), 42 | new OrdinalSales('2017', 75), 43 | ]; 44 | 45 | return [ 46 | new charts.Series( 47 | id: 'Sales', 48 | colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, 49 | domainFn: (OrdinalSales sales, _) => sales.year, 50 | measureFn: (OrdinalSales sales, _) => sales.sales, 51 | data: data, 52 | ) 53 | ]; 54 | } 55 | } 56 | 57 | /// Sample ordinal data type. 58 | class OrdinalSales { 59 | final String year; 60 | final int sales; 61 | 62 | OrdinalSales(this.year, this.sales); 63 | } 64 | ``` 65 | -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/simple_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/simple_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/simple_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/simple_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/spark_bar_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/spark_bar_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/spark_bar_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/spark_bar_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/stacked_fill_color_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/stacked_fill_color_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/stacked_fill_color_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/stacked_fill_color_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/stacked_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/stacked_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/stacked_horizontal_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/stacked_horizontal_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/stacked_horizontal_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/stacked_horizontal_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/stacked_target_line_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/stacked_target_line_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/stacked_target_line_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/stacked_target_line_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/stacked_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/stacked_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/vertical_bar_label_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/vertical_bar_label_full.png -------------------------------------------------------------------------------- /docs/flutter/example/bar_charts/vertical_bar_label_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/bar_charts/vertical_bar_label_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/chart_title_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/chart_title_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/chart_title_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/chart_title_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/initial_hint_animation_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/initial_hint_animation_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/initial_hint_animation_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/initial_hint_animation_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/initial_selection_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/initial_selection_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/initial_selection_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/initial_selection_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/percent_of_domain_by_category_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/percent_of_domain_by_category_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/percent_of_domain_by_category_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/percent_of_domain_by_category_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/percent_of_domain_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/percent_of_domain_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/percent_of_domain_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/percent_of_domain_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/percent_of_series_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/percent_of_series_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/percent_of_series_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/percent_of_series_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/selection_bar_highlight_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/selection_bar_highlight_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/selection_bar_highlight_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/selection_bar_highlight_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/selection_callback_example_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/selection_callback_example_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/selection_callback_example_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/selection_callback_example_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/selection_line_highlight_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/selection_line_highlight_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/selection_line_highlight_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/selection_line_highlight_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/selection_user_managed_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/selection_user_managed_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/selection_user_managed_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/selection_user_managed_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/slider_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/slider_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/slider_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/slider_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/sliding_viewport_on_selection_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/sliding_viewport_on_selection_full.png -------------------------------------------------------------------------------- /docs/flutter/example/behaviors/sliding_viewport_on_selection_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/behaviors/sliding_viewport_on_selection_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/date_time_line_point_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/date_time_line_point_full.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/date_time_line_point_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/date_time_line_point_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/numeric_line_bar_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/numeric_line_bar_full.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/numeric_line_bar_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/numeric_line_bar_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/numeric_line_point_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/numeric_line_point_full.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/numeric_line_point_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/numeric_line_point_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/ordinal_bar_line_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/ordinal_bar_line_full.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/ordinal_bar_line_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/ordinal_bar_line_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/scatter_plot_line_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/scatter_plot_line_full.png -------------------------------------------------------------------------------- /docs/flutter/example/combo_charts/scatter_plot_line_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/combo_charts/scatter_plot_line_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/i18ns/rtl_bar_chart_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/i18ns/rtl_bar_chart_full.png -------------------------------------------------------------------------------- /docs/flutter/example/i18ns/rtl_bar_chart_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/i18ns/rtl_bar_chart_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/i18ns/rtl_line_chart_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/i18ns/rtl_line_chart_full.png -------------------------------------------------------------------------------- /docs/flutter/example/i18ns/rtl_line_chart_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/i18ns/rtl_line_chart_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/i18ns/rtl_line_segments_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/i18ns/rtl_line_segments_full.png -------------------------------------------------------------------------------- /docs/flutter/example/i18ns/rtl_line_segments_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/i18ns/rtl_line_segments_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/i18ns/rtl_series_legend_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/i18ns/rtl_series_legend_full.png -------------------------------------------------------------------------------- /docs/flutter/example/i18ns/rtl_series_legend_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/i18ns/rtl_series_legend_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/datum_legend_options_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/datum_legend_options_full.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/datum_legend_options_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/datum_legend_options_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/datum_legend_with_measures_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/datum_legend_with_measures_full.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/datum_legend_with_measures_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/datum_legend_with_measures_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/default_hidden_series_legend_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/default_hidden_series_legend_full.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/default_hidden_series_legend_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/default_hidden_series_legend_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/legend_custom_symbol_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/legend_custom_symbol_full.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/legend_custom_symbol_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/legend_custom_symbol_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/series_legend_options_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/series_legend_options_full.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/series_legend_options_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/series_legend_options_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/series_legend_with_measures_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/series_legend_with_measures_full.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/series_legend_with_measures_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/series_legend_with_measures_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/simple_datum_legend.md: -------------------------------------------------------------------------------- 1 | # Simple Datum Legend Legends Example 2 | 3 | ![](simple_datum_legend_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Bar chart with series legend example 9 | import 'package:flutter/material.dart'; 10 | import 'package:charts_flutter/flutter.dart' as charts; 11 | 12 | class SimpleDatumLegend extends StatelessWidget { 13 | final List seriesList; 14 | final bool animate; 15 | 16 | SimpleDatumLegend(this.seriesList, {this.animate}); 17 | 18 | factory SimpleDatumLegend.withSampleData() { 19 | return new SimpleDatumLegend( 20 | _createSampleData(), 21 | // Disable animations for image tests. 22 | animate: false, 23 | ); 24 | } 25 | 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return new charts.PieChart( 30 | seriesList, 31 | animate: animate, 32 | // Add the series legend behavior to the chart to turn on series legends. 33 | // By default the legend will display above the chart. 34 | behaviors: [new charts.DatumLegend()], 35 | ); 36 | } 37 | 38 | /// Create series list with one series 39 | static List> _createSampleData() { 40 | final data = [ 41 | new LinearSales(0, 100), 42 | new LinearSales(1, 75), 43 | new LinearSales(2, 25), 44 | new LinearSales(3, 5), 45 | ]; 46 | 47 | return [ 48 | new charts.Series( 49 | id: 'Sales', 50 | domainFn: (LinearSales sales, _) => sales.year, 51 | measureFn: (LinearSales sales, _) => sales.sales, 52 | data: data, 53 | ) 54 | ]; 55 | } 56 | } 57 | 58 | /// Sample linear data type. 59 | class LinearSales { 60 | final int year; 61 | final int sales; 62 | 63 | LinearSales(this.year, this.sales); 64 | } 65 | ``` 66 | -------------------------------------------------------------------------------- /docs/flutter/example/legends/simple_datum_legend_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/simple_datum_legend_full.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/simple_datum_legend_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/simple_datum_legend_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/simple_series_legend_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/simple_series_legend_full.png -------------------------------------------------------------------------------- /docs/flutter/example/legends/simple_series_legend_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/legends/simple_series_legend_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/area_and_line_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/area_and_line_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/area_and_line_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/area_and_line_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/dash_pattern_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/dash_pattern_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/dash_pattern_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/dash_pattern_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/line_annotation_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/line_annotation_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/line_annotation_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/line_annotation_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/points.md: -------------------------------------------------------------------------------- 1 | # Points Line Chart Example 2 | 3 | ![](points_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Line chart example 9 | import 'package:charts_flutter/flutter.dart' as charts; 10 | import 'package:flutter/material.dart'; 11 | 12 | class PointsLineChart extends StatelessWidget { 13 | final List seriesList; 14 | final bool animate; 15 | 16 | PointsLineChart(this.seriesList, {this.animate}); 17 | 18 | /// Creates a [LineChart] with sample data and no transition. 19 | factory PointsLineChart.withSampleData() { 20 | return new PointsLineChart( 21 | _createSampleData(), 22 | // Disable animations for image tests. 23 | animate: false, 24 | ); 25 | } 26 | 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return new charts.LineChart(seriesList, 31 | animate: animate, 32 | defaultRenderer: new charts.LineRendererConfig(includePoints: true)); 33 | } 34 | 35 | /// Create one series with sample hard coded data. 36 | static List> _createSampleData() { 37 | final data = [ 38 | new LinearSales(0, 5), 39 | new LinearSales(1, 25), 40 | new LinearSales(2, 100), 41 | new LinearSales(3, 75), 42 | ]; 43 | 44 | return [ 45 | new charts.Series( 46 | id: 'Sales', 47 | colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, 48 | domainFn: (LinearSales sales, _) => sales.year, 49 | measureFn: (LinearSales sales, _) => sales.sales, 50 | data: data, 51 | ) 52 | ]; 53 | } 54 | } 55 | 56 | /// Sample linear data type. 57 | class LinearSales { 58 | final int year; 59 | final int sales; 60 | 61 | LinearSales(this.year, this.sales); 62 | } 63 | ``` 64 | -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/points_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/points_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/points_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/points_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/range_annotation_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/range_annotation_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/range_annotation_margin_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/range_annotation_margin_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/range_annotation_margin_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/range_annotation_margin_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/range_annotation_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/range_annotation_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/segments_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/segments_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/segments_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/segments_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/simple.md: -------------------------------------------------------------------------------- 1 | # Simple Line Chart Example 2 | 3 | ![](simple_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Example of a simple line chart. 9 | import 'package:charts_flutter/flutter.dart' as charts; 10 | import 'package:flutter/material.dart'; 11 | 12 | class SimpleLineChart extends StatelessWidget { 13 | final List seriesList; 14 | final bool animate; 15 | 16 | SimpleLineChart(this.seriesList, {this.animate}); 17 | 18 | /// Creates a [LineChart] with sample data and no transition. 19 | factory SimpleLineChart.withSampleData() { 20 | return new SimpleLineChart( 21 | _createSampleData(), 22 | // Disable animations for image tests. 23 | animate: false, 24 | ); 25 | } 26 | 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return new charts.LineChart(seriesList, animate: animate); 31 | } 32 | 33 | /// Create one series with sample hard coded data. 34 | static List> _createSampleData() { 35 | final data = [ 36 | new LinearSales(0, 5), 37 | new LinearSales(1, 25), 38 | new LinearSales(2, 100), 39 | new LinearSales(3, 75), 40 | ]; 41 | 42 | return [ 43 | new charts.Series( 44 | id: 'Sales', 45 | colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, 46 | domainFn: (LinearSales sales, _) => sales.year, 47 | measureFn: (LinearSales sales, _) => sales.sales, 48 | data: data, 49 | ) 50 | ]; 51 | } 52 | } 53 | 54 | /// Sample linear data type. 55 | class LinearSales { 56 | final int year; 57 | final int sales; 58 | 59 | LinearSales(this.year, this.sales); 60 | } 61 | ``` 62 | -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/simple_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/simple_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/simple_nulls_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/simple_nulls_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/simple_nulls_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/simple_nulls_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/simple_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/simple_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/stacked_area_custom_color_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/stacked_area_custom_color_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/stacked_area_custom_color_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/stacked_area_custom_color_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/stacked_area_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/stacked_area_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/stacked_area_nulls_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/stacked_area_nulls_full.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/stacked_area_nulls_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/stacked_area_nulls_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/line_charts/stacked_area_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/line_charts/stacked_area_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/auto_label_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/auto_label_full.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/auto_label_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/auto_label_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/donut.md: -------------------------------------------------------------------------------- 1 | # Donut Pie Chart Example 2 | 3 | ![](donut_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Donut chart example. This is a simple pie chart with a hole in the middle. 9 | import 'package:charts_flutter/flutter.dart' as charts; 10 | import 'package:flutter/material.dart'; 11 | 12 | class DonutPieChart extends StatelessWidget { 13 | final List seriesList; 14 | final bool animate; 15 | 16 | DonutPieChart(this.seriesList, {this.animate}); 17 | 18 | /// Creates a [PieChart] with sample data and no transition. 19 | factory DonutPieChart.withSampleData() { 20 | return new DonutPieChart( 21 | _createSampleData(), 22 | // Disable animations for image tests. 23 | animate: false, 24 | ); 25 | } 26 | 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return new charts.PieChart(seriesList, 31 | animate: animate, 32 | // Configure the width of the pie slices to 60px. The remaining space in 33 | // the chart will be left as a hole in the center. 34 | defaultRenderer: new charts.ArcRendererConfig(arcWidth: 60)); 35 | } 36 | 37 | /// Create one series with sample hard coded data. 38 | static List> _createSampleData() { 39 | final data = [ 40 | new LinearSales(0, 100), 41 | new LinearSales(1, 75), 42 | new LinearSales(2, 25), 43 | new LinearSales(3, 5), 44 | ]; 45 | 46 | return [ 47 | new charts.Series( 48 | id: 'Sales', 49 | domainFn: (LinearSales sales, _) => sales.year, 50 | measureFn: (LinearSales sales, _) => sales.sales, 51 | data: data, 52 | ) 53 | ]; 54 | } 55 | } 56 | 57 | /// Sample linear data type. 58 | class LinearSales { 59 | final int year; 60 | final int sales; 61 | 62 | LinearSales(this.year, this.sales); 63 | } 64 | ``` 65 | -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/donut_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/donut_full.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/donut_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/donut_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/gauge.md: -------------------------------------------------------------------------------- 1 | # Gauge Pie Chart Example 2 | 3 | ![](gauge_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Gauge chart example, where the data does not cover a full revolution in the 9 | /// chart. 10 | import 'package:charts_flutter/flutter.dart' as charts; 11 | import 'package:flutter/material.dart'; 12 | 13 | class GaugeChart extends StatelessWidget { 14 | final List seriesList; 15 | final bool animate; 16 | 17 | GaugeChart(this.seriesList, {this.animate}); 18 | 19 | /// Creates a [PieChart] with sample data and no transition. 20 | factory GaugeChart.withSampleData() { 21 | return new GaugeChart( 22 | _createSampleData(), 23 | // Disable animations for image tests. 24 | animate: false, 25 | ); 26 | } 27 | 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return new charts.PieChart(seriesList, 32 | animate: animate, 33 | // Configure the width of the pie slices to 30px. The remaining space in 34 | // the chart will be left as a hole in the center. Adjust the start 35 | // angle and the arc length of the pie so it resembles a gauge. 36 | defaultRenderer: new charts.ArcRendererConfig( 37 | arcWidth: 30, startAngle: 4 / 5 * pi, arcLength: 7 / 5 * pi)); 38 | } 39 | 40 | /// Create one series with sample hard coded data. 41 | static List> _createSampleData() { 42 | final data = [ 43 | new GaugeSegment('Low', 75), 44 | new GaugeSegment('Acceptable', 100), 45 | new GaugeSegment('High', 50), 46 | new GaugeSegment('Highly Unusual', 5), 47 | ]; 48 | 49 | return [ 50 | new charts.Series( 51 | id: 'Segments', 52 | domainFn: (GaugeSegment segment, _) => segment.segment, 53 | measureFn: (GaugeSegment segment, _) => segment.size, 54 | data: data, 55 | ) 56 | ]; 57 | } 58 | } 59 | 60 | /// Sample data type. 61 | class GaugeSegment { 62 | final String segment; 63 | final int size; 64 | 65 | GaugeSegment(this.segment, this.size); 66 | } 67 | ``` 68 | -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/gauge_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/gauge_full.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/gauge_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/gauge_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/outside_label_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/outside_label_full.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/outside_label_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/outside_label_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/partial_pie.md: -------------------------------------------------------------------------------- 1 | # Partial Pie Pie Chart Example 2 | 3 | ![](partial_pie_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Partial pie chart example, where the data does not cover a full revolution 9 | /// in the chart. 10 | import 'package:charts_flutter/flutter.dart' as charts; 11 | import 'package:flutter/material.dart'; 12 | 13 | class PartialPieChart extends StatelessWidget { 14 | final List seriesList; 15 | final bool animate; 16 | 17 | PartialPieChart(this.seriesList, {this.animate}); 18 | 19 | /// Creates a [PieChart] with sample data and no transition. 20 | factory PartialPieChart.withSampleData() { 21 | return new PartialPieChart( 22 | _createSampleData(), 23 | // Disable animations for image tests. 24 | animate: false, 25 | ); 26 | } 27 | 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | // Configure the pie to display the data across only 3/4 instead of the full 32 | // revolution. 33 | return new charts.PieChart(seriesList, 34 | animate: animate, 35 | defaultRenderer: new charts.ArcRendererConfig(arcLength: 3 / 2 * pi)); 36 | } 37 | 38 | /// Create one series with sample hard coded data. 39 | static List> _createSampleData() { 40 | final data = [ 41 | new LinearSales(0, 100), 42 | new LinearSales(1, 75), 43 | new LinearSales(2, 25), 44 | new LinearSales(3, 5), 45 | ]; 46 | 47 | return [ 48 | new charts.Series( 49 | id: 'Sales', 50 | domainFn: (LinearSales sales, _) => sales.year, 51 | measureFn: (LinearSales sales, _) => sales.sales, 52 | data: data, 53 | ) 54 | ]; 55 | } 56 | } 57 | 58 | /// Sample linear data type. 59 | class LinearSales { 60 | final int year; 61 | final int sales; 62 | 63 | LinearSales(this.year, this.sales); 64 | } 65 | ``` 66 | -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/partial_pie_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/partial_pie_full.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/partial_pie_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/partial_pie_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/simple.md: -------------------------------------------------------------------------------- 1 | # Simple Pie Chart Example 2 | 3 | ![](simple_full.png) 4 | 5 | Example: 6 | 7 | ``` 8 | /// Simple pie chart example. 9 | import 'package:charts_flutter/flutter.dart' as charts; 10 | import 'package:flutter/material.dart'; 11 | 12 | class SimplePieChart extends StatelessWidget { 13 | final List seriesList; 14 | final bool animate; 15 | 16 | SimplePieChart(this.seriesList, {this.animate}); 17 | 18 | /// Creates a [PieChart] with sample data and no transition. 19 | factory SimplePieChart.withSampleData() { 20 | return new SimplePieChart( 21 | _createSampleData(), 22 | // Disable animations for image tests. 23 | animate: false, 24 | ); 25 | } 26 | 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return new charts.PieChart(seriesList, animate: animate); 31 | } 32 | 33 | /// Create one series with sample hard coded data. 34 | static List> _createSampleData() { 35 | final data = [ 36 | new LinearSales(0, 100), 37 | new LinearSales(1, 75), 38 | new LinearSales(2, 25), 39 | new LinearSales(3, 5), 40 | ]; 41 | 42 | return [ 43 | new charts.Series( 44 | id: 'Sales', 45 | domainFn: (LinearSales sales, _) => sales.year, 46 | measureFn: (LinearSales sales, _) => sales.sales, 47 | data: data, 48 | ) 49 | ]; 50 | } 51 | } 52 | 53 | /// Sample linear data type. 54 | class LinearSales { 55 | final int year; 56 | final int sales; 57 | 58 | LinearSales(this.year, this.sales); 59 | } 60 | ``` 61 | -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/simple_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/simple_full.png -------------------------------------------------------------------------------- /docs/flutter/example/pie_charts/simple_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/pie_charts/simple_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/scatter_plot_charts/bucketing_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/scatter_plot_charts/bucketing_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/scatter_plot_charts/bucketing_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/scatter_plot_charts/bucketing_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/scatter_plot_charts/comparison_points_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/scatter_plot_charts/comparison_points_full.png -------------------------------------------------------------------------------- /docs/flutter/example/scatter_plot_charts/comparison_points_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/scatter_plot_charts/comparison_points_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/scatter_plot_charts/shapes_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/scatter_plot_charts/shapes_full.png -------------------------------------------------------------------------------- /docs/flutter/example/scatter_plot_charts/shapes_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/scatter_plot_charts/shapes_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/scatter_plot_charts/simple_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/scatter_plot_charts/simple_full.png -------------------------------------------------------------------------------- /docs/flutter/example/scatter_plot_charts/simple_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/scatter_plot_charts/simple_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/confidence_interval_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/confidence_interval_full.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/confidence_interval_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/confidence_interval_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/end_points_axis_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/end_points_axis_full.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/end_points_axis_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/end_points_axis_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/line_annotation_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/line_annotation_full.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/line_annotation_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/line_annotation_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/range_annotation_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/range_annotation_full.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/range_annotation_margin_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/range_annotation_margin_full.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/range_annotation_margin_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/range_annotation_margin_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/range_annotation_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/range_annotation_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/simple_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/simple_full.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/simple_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/simple_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/symbol_annotation_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/symbol_annotation_full.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/symbol_annotation_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/symbol_annotation_thumb.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/with_bar_renderer_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/with_bar_renderer_full.png -------------------------------------------------------------------------------- /docs/flutter/example/time_series_charts/with_bar_renderer_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzyzcjy/charts/de76a46c1908b0c35aaf60823100fe9bfa26ae4d/docs/flutter/example/time_series_charts/with_bar_renderer_thumb.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Charts 2 | 3 | The charting framework is currently supported for the 4 | [Flutter](https://flutter.io) platform. 5 | 6 | Please see the 7 | [charts_flutter page on pub dev](https://pub.dev/packages/charts_flutter) 8 | for reference or the 9 | [online gallery of Flutter charts](https://google.github.io/charts/flutter/gallery.html) 10 | for examples. 11 | --------------------------------------------------------------------------------