chart library

Library for creating highly customizable charts

Classes

AnimatedChart<T>
Extended ImplicitlyAnimatedWidget, that will animate the chart on every change of the ChartState.
BarGeometryPainter<T>
Paint bar value item.
BarItem
BarItemBuilderLerp
BarItemOptions
Extension options for bar items geometryPainter is set to BarGeometryPainter
BarValue<T>
Bar value items have min locked to 0.0 (or ChartData.axisMin if defined) Value for bar item can be negative
BorderDecoration
Paints border around the whole chart
BoxPaneParentData
BubbleGeometryPainter<T>
Paint bubble value item.
BubbleItem
BubbleItemBuilderLerp
BubbleItemOptions
Extension options for bar items geometryPainter is set to BubbleGeometryPainter
BubbleValue<T>
Bubble value items max values that are just shown as a point Values can go negative
CandleValue<T>
Candle value items have min and max set up Values can go negative
Chart<T>
Draw _ChartWidget with set state, width and height for the chart
ChartBehaviour
Behaviour of the chart isScrollable - If chart is scrollable then width of canvas is ignored and chart will take any size it needs. Chart has to be wrapped with SingleChildScrollView or similar scrollable widget. onItemClicked - Returns index of clicked item.
ChartData<T>
axisMin - Min value that has to be displayed on the chart, if data contains value that is lower than axisMin in that case axisMin is ignored and actual min value is shown.
ChartDataRenderer<T>
Renderer for whole chart data
ChartDecorationChildRenderer<T>
ChartDecorationRenderer<T>
ChartItem<T>
Default ChartItem
ChartItemData
ChartItemRenderer<T>
ChartItemsLerp
Lerp items in the charts
ChartLinearDataRenderer<T>
Align chart data items in linear fashion. Meaning X axis cannot be changed. X axis becomes the index of current item height of the item is defined by item max or min value.
ChartRenderer<T>
Chart renderer will break up all chart data into it's own ChartDataRenderer that they use, Along with adding all FixedDecorationsRendererers with their renderers.
ChartState<T>
Main state of the charts. Painter will use this as state and it will format chart depending on options.
ChartStateTween<T>
Tween for animating between two different ChartState's
ChildChartItemRenderer<T>
Child item renderer for chart items. It will render any Widget passed as child. It will constrain it to exact size. Make sure you are not using transparent widgets that could taint the data shown!
DataStrategy
Data strategy will process the data one final time before being passed to painters
DecorationPainter
Abstract class for decorations Decorations are placed under and/or above items in the charts
DecorationsRenderer<T>
DefaultDataStrategy
Used by default and it won't do anything to the data just pass it along
DrawDataItem
Data needed for drawing on the canvas
GeometryPainter<T>
Item painter for charts Chart will slice the canvas and each item is painted has constraints (width / itemWidth) * height
GridDecoration
Draws a grid with verticalAxisStep and horizontalAxisStep as spacers
HorizontalAxisDecoration
Decoration for drawing horizontal lines on the chart, decoration can add horizontal axis legend
ItemBuilderData<T>
Data that can be used when building items to make each item appear different.
ItemOptions
Options for chart items. You can use this subclasses: BarItemOptions, BubbleItemOptions, WidgetItemOptions
LeafChartItemRenderer<T>
Default renderer for all chart items. Renderers use different painters to paint themselves.
ScrollSettings
SelectedItemDecoration
Show selected item in Cupertino style (Health app)
SparkLineDecoration
Sparkline (Line graph) is considered to be just a decoration. You need to use BarGeometryPainter or BubbleGeometryPainter in combination. They can be transparent or be used to show values of the graph
StackDataStrategy
Stacks multiple lists one on top of another.
TargetAreaDecoration
Target area decoration, draw a RRect on the chart as target range To actually change item colors you have to also set colorOverTarget
TargetLineDecoration
Target line decoration will draw target line horizontally across the chart height of the line is defined by target
TargetLineLegendDecoration
Show text on the left side of the chart, this text will be at TargetLineDecoration or at max value of TargetAreaDecoration.
ValueDecoration
Draw value of the items on them. Use this only as ChartState.foregroundDecorations in order to be visible at all locations Exact alignment can be set with alignment
VerticalAxisDecoration
Decoration for drawing vertical lines on the chart, decoration can add vertical axis legend
WidgetDecoration
Show widget as decoration on the chart
WidgetItemOptions
Options for widget items.

Functions

barPainter<T>(ChartItem<T> item, ChartData<T> data, ItemOptions itemOptions, DrawDataItem drawDataItem) GeometryPainter<T>
Bar painter
bubblePainter<T>(ChartItem<T> item, ChartData<T> data, ItemOptions itemOptions, DrawDataItem drawDataItem) GeometryPainter<T>
Bubble painter
dashPath(Path source, {required List<double> dashArray}) Path
Creates a new path that is drawn from the segments of source. Passing a source that is an empty path will return an empty path.
defaultAxisValue(int index) String
Default axis generator, it will just take current index, convert it to string and return it.
defaultValueForItem(ChartItem item) double

Typedefs

AxisValueFromIndex = String Function(int index)
AxisValueFromValue = String Function(int value)
BarItemBuilder<T> = BarItem Function(ItemBuilderData data)
BubbleItemBuilder<T> = BubbleItem Function(ItemBuilderData<T>)
ChartDataRendererFactory<T> = ChartDataRenderer<T> Function(ChartState<T?> state)
ChartGeometryPainter<T> = GeometryPainter<T> Function(ChartItem<T?> item, ChartData data, ItemOptions itemOptions, DrawDataItem drawDataItem)
Item painter, use barPainter or bubblePainter. Custom painter can also be added by extending GeometryPainter
ItemBuilder<T> = dynamic Function(ItemBuilderData<T>)
LabelFromItem = String Function(ChartItem item)
ShowLineForValue = bool Function(int value)
ValueFromItem = double Function(ChartItem item)
WidgetDecorationBuilder<T> = Widget Function(BuildContext context, ChartState<T> chartState, double itemWidth, double verticalMultiplier)
WidgetItemBuilder<T> = Widget Function(ItemBuilderData<T>)