fl_chart library Null safety

Classes

AxisChartData
This is the base class for axis base charts data that contains a FlGridData that holds data for showing grid lines, also we have minX, maxX, minY, maxY values we use them to determine how much is the scale of chart, and calculate x and y according to the scale. each child have to set it in their constructor.
AxisTitle
Holds data for showing title of each side of charts.
BackgroundBarChartRodData
Holds values to draw a rod in rear of the main rod. [...]
BadgeWidgetsDelegate
Positions the badge widgets on their respective sections.
BarAreaData
Holds data for filling an area (above or below) of the line with a color or gradient.
BarAreaSpotsLine
Holds data for drawing line on the spots under the BarAreaData.
BarChart
Renders a bar chart as a widget, using provided BarChartData.
BarChartData
BarChart needs this class to render itself. [...]
BarChartDataTween
It lerps a BarChartData to another BarChartData (handles animation for updating values)
BarChartGroupData
Represents a group of rods (or bars) inside the BarChart. [...]
BarChartRodData
Holds data about rendering each rod (or bar) in the BarChart.
BarChartRodStackItem
A colored section of Stacked Chart rod item [...]
BarTooltipItem
Holds data needed for showing custom tooltip content.
BarTouchData
Holds data to handle touch events, and touch responses in the BarChart. [...]
BarTouchedSpot
It gives you information about the touched spot.
BarTouchResponse
Holds information about touch response in the BarChart. [...]
BarTouchTooltipData
Holds representation data for showing tooltip popup on top of rods.
BaseChartData
This class holds all data needed for BaseChartPainter. [...]
BaseTouchResponse
This class holds the touch response details of charts.
BetweenBarsData
Holds data about filling below or above space of the bar line,
ExtraLinesData
Draws some straight horizontal or vertical lines in the LineChart
FlAxisTitleData
Holds data for showing a title in each side (left, top, right, bottom) of the chart.
FlBorderData
Holds data to drawing border around the chart.
FlClipData
Holds data to clipping chart around its borders.
FlDotCirclePainter
This class is an implementation of a FlDotPainter that draws a circled shape
FlDotCrossPainter
This class is an implementation of a FlDotPainter that draws a cross (X mark) shape
FlDotData
This class holds data about drawing spot dots on the drawing bar line.
FlDotPainter
This class contains the interface that all DotPainters should conform to.
FlDotSquarePainter
This class is an implementation of a FlDotPainter that draws a squared shape
FlGridData
Responsible to hold grid data,
FlLine
Defines style of a line.
FlLineLabel
Shows a text label
FlLongPressEnd
When a pointer stops contacting the screen after a long press gesture was detected. Also reports the position where the pointer stopped contacting the screen. [...]
FlLongPressMoveUpdate
When a pointer is moving after being held in contact at the same location for a long period of time. Reports the new position and its offset from the original down position. [...]
FlLongPressStart
Called When a pointer has remained in contact with the screen at the same location for a long period of time. [...]
FlPanCancelEvent
When the pointer that previously triggered a FlPanStartEvent did not complete. Inspired from GestureDragCancelCallback
FlPanDownEvent
When a pointer has contacted the screen and might begin to move [...]
FlPanEndEvent
When a pointer that was previously in contact with the screen and moving is no longer in contact with the screen. [...]
FlPanStartEvent
When a pointer has contacted the screen and has begun to move. [...]
FlPanUpdateEvent
When a pointer that is in contact with the screen and moving has moved again. [...]
FlPointerEnterEvent
The pointer has moved with respect to the device while the pointer is or is not in contact with the device, and it has entered our chart. [...]
FlPointerExitEvent
The pointer has moved with respect to the device while the pointer is or is not in contact with the device, and exited our chart. [...]
FlPointerHoverEvent
The pointer has moved with respect to the device while the pointer is not in contact with the device. [...]
FlSpot
Represents a conceptual position in cartesian (axis based) space.
FlTapCancelEvent
When the pointer that previously triggered a FlTapDownEvent will not end up causing a tap. Inspired from GestureTapCancelCallback
FlTapDownEvent
When a pointer that might cause a tap has contacted the screen. [...]
FlTapUpEvent
When a pointer that will trigger a tap has stopped contacting the screen. [...]
FlTitlesData
Holds data for showing titles on each side of charts (a title per each axis value).
FlTouchData<R extends BaseTouchResponse>
Holds data to handle touch events, and touch responses in abstract way. [...]
FlTouchEvent
Parent class for several kind of touch/pointer events (like tap, panMode, longPressStart, ...)
HorizontalLine
Holds data for drawing extra horizontal lines. [...]
HorizontalLineLabel
Draws a title on the HorizontalLine
HorizontalRangeAnnotation
Defines an annotation region in y (vertical) axis.
LineBarSpot
Represent a targeted spot inside a line bar.
LineChart
Renders a line chart as a widget, using provided LineChartData.
LineChartBarData
Holds data for drawing each individual line in the LineChart
LineChartData
LineChart needs this class to render itself. [...]
LineChartDataTween
It lerps a LineChartData to another LineChartData (handles animation for updating values)
LineChartStepData
Holds data for representing a Step Line Chart, and works only if LineChartBarData.isStepChart is true.
LineTooltipItem
Holds data of showing each row item in the tooltip popup.
LineTouchData
Holds data to handle touch events, and touch responses in the LineChart. [...]
LineTouchResponse
Holds information about touch response in the LineChart. [...]
LineTouchTooltipData
Holds representation data for showing tooltip popup on top of spots.
PieChart
Renders a pie chart as a widget, using provided PieChartData.
PieChartData
PieChart needs this class to render itself. [...]
PieChartDataTween
It lerps a PieChartData to another PieChartData (handles animation for updating values)
PieChartSectionData
Holds data related to drawing each PieChart section.
PieTouchData
Holds data to handle touch events, and touch responses in the PieChart. [...]
PieTouchedSection
PieTouchResponse
Holds information about touch response in the PieChart. [...]
RadarChart
Renders a radar chart as a widget, using provided RadarChartData.
RadarChartData
RadarChart needs this class to render itself. [...]
RadarChartDataTween
It lerps a RadarChartData to another RadarChartData (handles animation for updating values)
RadarDataSet
the data values for drawing RadarChart sections
RadarEntry
holds the data about each entry or point in RadarChart
RadarTouchData
Holds data to handle touch events, and touch responses in the RadarChart. [...]
RadarTouchedSpot
It gives you information about the touched spot.
RadarTouchResponse
Holds information about touch response in the RadarTouchResponse. [...]
RangeAnnotations
Holds data for rendering horizontal and vertical range annotations.
ScatterChart
Renders a pie chart as a widget, using provided ScatterChartData.
ScatterChartData
ScatterChart needs this class to render itself. [...]
ScatterChartDataTween
It lerps a ScatterChartData to another ScatterChartData (handles animation for updating values)
ScatterSpot
Defines information about a spot in the ScatterChart
ScatterTooltipItem
Holds data of showing each item in the tooltip popup.
ScatterTouchData
Holds data to handle touch events, and touch responses in the ScatterChart. [...]
ScatterTouchedSpot
Holds the touched spot data
ScatterTouchResponse
Holds information about touch response in the ScatterChart. [...]
ScatterTouchTooltipData
Holds representation data for showing tooltip popup on top of spots.
ShowingTooltipIndicators
Holds data for showing tooltips over a line
SideTitles
Holds data for showing each side titles (a title per each axis value).
SizedPicture
Holds data for showing a vector image inside the chart. [...]
TouchedSpot
holds information about touched spot on the axis based charts.
TouchedSpotIndicatorData
details of showing indicator when touch happened on LineChart indicatorBelowLine we draw a vertical line below of the touched spot touchedSpotDotData we draw a larger dot on the touched spot to bold it
VerticalLine
Holds data for drawing extra vertical lines. [...]
VerticalLineLabel
Draws a title on the VerticalLine
VerticalRangeAnnotation
Defines an annotation region in x (horizontal) axis.

Functions

defaultBarTooltipItem(BarChartGroupData group, int groupIndex, BarChartRodData rod, int rodIndex) BarTooltipItem?
Default implementation for BarTouchTooltipData.getTooltipItem.
defaultCheckToShowTitle(double minValue, double maxValue, SideTitles sideTitles, double appliedInterval, double value) bool
The default SideTitles.checkToShowTitle function. [...]
defaultGetTitle(double value) String
The default SideTitles.getTitles function. [...]
defaultGetTitleTextStyle(BuildContext context, double value) TextStyle?
The default SideTitles.getTextStyles function. [...]
defaultGetTouchLineEnd(LineChartBarData barData, int spotIndex) double
By default line ends at the touched point.
defaultGetTouchLineStart(LineChartBarData barData, int spotIndex) double
By default line starts from the bottom of the chart.
defaultGridLine(double value) FlLine
Returns a grey line for all values.
defaultLineTooltipItem(List<LineBarSpot> touchedSpots) List<LineTooltipItem>
Default implementation for LineTouchTooltipData.getTooltipItems.
defaultScatterTooltipItem(ScatterSpot touchedSpot) ScatterTooltipItem?
Default implementation for ScatterTouchTooltipData.getTooltipItems.
defaultTouchedIndicators(LineChartBarData barData, List<int> indicators) List<TouchedSpotIndicatorData>
Default presentation of touched indicators.
showAllDots(FlSpot spot, LineChartBarData barData) bool
Shows all dots on spots.
showAllGrids(double value) bool
Shows all lines.
showAllSpotsBelowLine(FlSpot spot) bool
Shows all spot lines.

Enums

BarChartAlignment
defines arrangement of barGroups, check MainAxisAlignment for more details.
TooltipDirection
Controls showing tooltip on top or bottom.

Typedefs

BaseTouchCallback<R extends BaseTouchResponse> = void Function(FlTouchEvent, R?)
Chart's touch callback.
CheckToShowDot = bool Function(FlSpot spot, LineChartBarData barData)
It determines showing or hiding FlDotData on the spots. [...]
CheckToShowGrid = bool Function(double value)
Determines showing or hiding specified line.
CheckToShowSpotLine = bool Function(FlSpot spot)
It used for determine showing or hiding BarAreaSpotsLines [...]
CheckToShowTitle = bool Function(double minValue, double maxValue, SideTitles sideTitles, double appliedInterval, double value)
Determines showing or hiding specified title.
GetBarTooltipItem = BarTooltipItem? Function(BarChartGroupData group, int groupIndex, BarChartRodData rod, int rodIndex)
Provides a BarTooltipItem for showing content inside the BarTouchTooltipData. [...]
GetDotColorCallback = Color Function(FlSpot, double, LineChartBarData)
The callback passed to get the color of a FlSpot [...]
GetDotPainterCallback = FlDotPainter Function(FlSpot, double, LineChartBarData, int)
The callback passed to get the painter of a FlSpot [...]
GetDrawingGridLine = FlLine Function(double value)
Determines the appearance of specified line. [...]
GetLineTooltipItems = List<LineTooltipItem?> Function(List<LineBarSpot> touchedSpots)
Provides a LineTooltipItem for showing content inside the LineTouchTooltipData. [...]
GetScatterTooltipItems = ScatterTooltipItem? Function(ScatterSpot touchedSpot)
Provides a ScatterTooltipItem for showing content inside the ScatterTouchTooltipData. [...]
GetTitleByIndexFunction = String Function(int index)
GetTitleFunction = String Function(double value)
It gives you the axis value and gets a String value based on it.
GetTitleTextStyleFunction = TextStyle? Function(BuildContext context, double value)
It gives you the axis value and gets a TextStyle based on given value [...]
GetTouchedSpotIndicator = List<TouchedSpotIndicatorData?> Function(LineChartBarData barData, List<int> spotIndexes)
Used for showing touch indicators (a thicker line and larger dot on the targeted spot). [...]
GetTouchLineY = double Function(LineChartBarData barData, int spotIndex)
Used for determine the touch indicator line's starting/end point.
MouseCursorResolver<R extends BaseTouchResponse> = MouseCursor Function(FlTouchEvent, R?)
It gives you the happened FlTouchEvent and existed R data at the event's location, then you should provide a MouseCursor to change the cursor at the event's location. For example you can pass the SystemMouseCursors.click to change the mouse cursor to click.
ScatterTouchCallback = void Function(ScatterTouchResponse)
ScatterChart's touch callback.