Skip to main content

BaseChart

FlBorderData​

showbool?#defaulttrue

Determines whether to show or hide the border.

borderBorder?#defaultBorder.all()

Determines which sides of the border are drawn, and how, see Border.

FlTitlesData​

showbool#defaulttrue

Determines whether to show or hide the titles around the chart.

leftTitlesAxisTitles#defaultconst AxisTitles(sideTitles: SideTitles(reservedSize: 44, showTitles: true))

Holds data to draw the titles on the left side of the chart, see AxisTitles.

topTitlesAxisTitles#defaultconst AxisTitles(sideTitles: SideTitles(reservedSize: 30, showTitles: true))

Holds data to draw the titles on the top side of the chart, see AxisTitles.

rightTitlesAxisTitles#defaultconst AxisTitles(sideTitles: SideTitles(reservedSize: 44, showTitles: true))

Holds data to draw the titles on the right side of the chart, see AxisTitles.

bottomTitlesAxisTitles#defaultconst AxisTitles(sideTitles: SideTitles(reservedSize: 30, showTitles: true))

Holds data to draw the titles on the bottom side of the chart, see AxisTitles.

AxisTitles​

axisNameWidgetWidget?#defaultnull

It shows the name of axis, for example your x-axis shows year, then you might want to show it using axisNameWidget property as a widget

axisNameSizedouble#default16

Determines the size of axisNameWidget.

sideTitlesSideTitles#defaultconst SideTitles()

It is responsible to show your axis side labels.

drawBelowEverythingbool#defaulttrue

If titles are showing on top of your tooltip, you can draw them below everything.

In the future, we will convert tooltips to a widget, that would solve this problem.

sideTitleAlignmentSideTitleAlignment#defaultSideTitleAlignment.outside

Where the SideTitles are drawn in relation to the chart.

SideTitles​

showTitlesbool#defaultfalse

Determines showing or hiding this side titles

getTitlesWidgetWidget Function(double, TitleMeta)#defaultdefaultGetTitle

You can override it to pass your custom widget to show in each axis value We recommend you to use SideTitleWidget.

If you decide to implement your custom widget (instead of SideTitleWidget), you have to take care of the alignment, space to the chart and also the rotation (if you are rotating the chart, for example for Horizontal Bar Chart)

reservedSizedouble#default22

It determines the maximum space that your titles need, (All titles will stretch using this value)

intervaldouble?#defaultnull

Texts are showing with provided interval. If you don't provide anything, we try to find a suitable value to set as interval under the hood.

minIncludedbool#defaulttrue

If true (default), a title for the minimum data value is included independent of the sampling interval

maxIncludedbool#defaulttrue

If true (default), a title for the maximum data value is included independent of the sampling interval

SideTitleFitInsideData​

enabledbool#required

Whether to enable fit inside to SideTitleWidget

axisPositiondouble#required

The position (in pixel) that applied to the child widget along its corresponding axis.

parentAxisSizedouble#required

Parent axis max width/height

distanceFromEdgedouble#required

Distance between child widget and its closest corresponding axis edge

FlGridData​

showbool#defaulttrue

Determines showing or hiding all horizontal and vertical lines.

drawHorizontalLinebool#defaulttrue

Determines showing or hiding all horizontal lines.

horizontalIntervaldouble?#defaultnull

Determines interval between horizontal lines, left it null to be auto calculated.

getDrawingHorizontalLineFlLine Function(double)#defaultdefaultGridLine

Gives you a y value, and gets a FlLine that represents specified line.

checkToShowHorizontalLinebool Function(double)#defaultshowAllGrids

Gives you a y value, and gets a boolean that determines showing or hiding specified line.

drawVerticalLinebool#defaulttrue

Determines showing or hiding all vertical lines.

verticalIntervaldouble?#defaultnull

Determines interval between vertical lines, left it null to be auto calculated.

getDrawingVerticalLineFlLine Function(double)#defaultdefaultGridLine

Gives you a x value, and gets a FlLine that represents specified line.

checkToShowVerticalLinebool Function(double)#defaultshowAllGrids

Gives you a x value, and gets a boolean that determines showing or hiding specified line.

FlLabel​

showbool#defaulttrue

Whether the label is visible.

textString#default''

The text content of the label.

styleTextStyle?#defaultnull

The text style of the label.

When null (or when its inherit is true), it is merged with the ambient DefaultTextStyle, and it respects the bold text setting of the platform.

angledouble#default0

Rotation angle of the label in degrees.

textDirectionTextDirection#defaultTextDirection.ltr

Text direction of the label.

FlSpot​

xdouble#required

The x value of the spot, on the horizontal axis (from left to right).

ydouble#required

The y value of the spot, on the vertical axis (from bottom to top).

xErrorFlErrorRange?#defaultnull

The error range of the spot on the x axis, drawn by the errorIndicatorData of the chart, see FlErrorRange.

yErrorFlErrorRange?#defaultnull

The error range of the spot on the y axis, drawn by the errorIndicatorData of the chart, see FlErrorRange.

FlLine​

colorColor?#

Defines color of the line.

Defaults to Colors.black if neither color nor gradient is provided.

gradientGradient?#defaultnull

Defines the gradient of the line.

strokeWidthdouble#default2

Defines thickness of the line.

dashArrayList<int>?#defaultnull

Defines dash effect of the line.

it is a circular array of dash offsets and lengths. For example, the array [5, 10] would result in dashes 5 pixels long followed by blank spaces 10 pixels long.

TouchedSpot​

spotFlSpot#

Represents the spot inside our axis based chart, 0, 0 is bottom left, and 1, 1 is top right.

offsetOffset#

Represents the touch position in device pixels, 0, 0 is top, left, and 1, 1 is bottom right.

RangeAnnotations​

horizontalRangeAnnotationsList<HorizontalRangeAnnotation>#defaultconst []

Horizontal ranges to highlight, see HorizontalRangeAnnotation.

verticalRangeAnnotationsList<VerticalRangeAnnotation>#defaultconst []

Vertical ranges to highlight, see VerticalRangeAnnotation.

HorizontalRangeAnnotation​

y1double#required

Determines starting point in vertical (y) axis.

y2double#required

Determines ending point in vertical (y) axis.

colorColor?#

If provided, this HorizontalRangeAnnotation draws with this color Otherwise we use gradient to draw the background. It draws with gradient if you provide both color and gradient. If none is provided, it draws with a white color.

gradientGradient?#defaultnull

If provided, this HorizontalRangeAnnotation draws with this gradient Otherwise we use color to draw the background. It draws with gradient if you provide both color and gradient. If none is provided, it draws with a white color.

VerticalRangeAnnotation​

x1double#required

Determines starting point in horizontal (x) axis.

x2double#required

Determines ending point in horizontal (x) axis.

colorColor?#

If provided, this VerticalRangeAnnotation draws with this color Otherwise we use gradient to draw the background. It draws with gradient if you provide both color and gradient. If none is provided, it draws with a white color.

gradientGradient?#defaultnull

If provided, this VerticalRangeAnnotation draws with this gradient Otherwise we use color to draw the background. It draws with gradient if you provide both color and gradient. If none is provided, it draws with a white color.

FlTouchEvent​

Base class for all supported touch/pointer events.

PropNameDescriptionInspired from
FlPanDownEventContains information of happened touch gestureGestureDragDownCallback
FlPanStartEventWhen a pointer has contacted the screen and has begun to move.GestureDragStartCallback
FlPanUpdateEventWhen a pointer that is in contact with the screen and moving has moved again.GestureDragUpdateCallback
FlPanCancelEventWhen the pointer that previously triggered a FlPanStartEvent did not complete.GestureDragCancelCallback
FlPanEndEventWhen a pointer that was previously in contact with the screen and moving is no longer in contact with the screen.GestureDragEndCallback
FlTapDownEventWhen a pointer that might cause a tap has contacted the screen.GestureTapDownCallback
FlTapCancelEventWhen the pointer that previously triggered a FlTapDownEvent will not end up causing a tap.GestureTapCancelCallback
FlTapUpEventWhen a pointer that will trigger a tap has stopped contacting the screen.GestureTapUpCallback
FlSecondaryTapDownEventWhen a secondary pointer that might cause a tap has contacted the screen.GestureTapDownCallback
FlSecondaryTapCancelEventWhen the secondary pointer that previously triggered a FlSecondaryTapDownEvent will not end up causing a tap.GestureTapCancelCallback
FlSecondaryTapUpEventWhen a secondary pointer that will trigger a tap has stopped contacting the screen.GestureTapUpCallback
FlLongPressStartCalled When a pointer has remained in contact with the screen at the same location for a long period of time.GestureLongPressStartCallback
FlLongPressMoveUpdateWhen 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.GestureLongPressMoveUpdateCallback
FlLongPressEndWhen a pointer stops contacting the screen after a long press gesture was detected. Also reports the position where the pointer stopped contacting the screen.GestureLongPressEndCallback
FlSecondaryLongPressStartCalled when a secondary pointer has remained in contact with the screen at the same location for a long period of time.GestureLongPressStartCallback
FlSecondaryLongPressMoveUpdateWhen a secondary 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.GestureLongPressMoveUpdateCallback
FlSecondaryLongPressEndWhen a secondary pointer stops contacting the screen after a long press gesture was detected. Also reports the position where the pointer stopped contacting the screen.GestureLongPressEndCallback
FlPointerEnterEventThe 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.PointerEnterEventListener
FlPointerHoverEventThe pointer has moved with respect to the device while the pointer is not in contact with the device.PointerHoverEventListener
FlPointerExitEventThe pointer has moved with respect to the device while the pointer is or is not in contact with the device, and exited our chart.PointerExitEventListener

ExtraLinesData​

horizontalLinesList<HorizontalLine>#defaultconst []

Horizontal lines to draw on the chart, see HorizontalLine.

verticalLinesList<VerticalLine>#defaultconst []

Vertical lines to draw on the chart, see VerticalLine.

extraLinesOnTopbool#defaulttrue

If true, the extra lines are drawn above the data of the chart, otherwise below it.

HorizontalLine​

ydouble#required

Draws from left to right of the chart using the y value.

labelHorizontalLineLabel?#defaultHorizontalLineLabel()

Draws a text label over the line.

colorColor?#defaultnull

Defines color of the line.

Defaults to Colors.black if neither color nor gradient is provided.

gradientGradient?#defaultnull

Defines the gradient of the line.

strokeWidthdouble#default2

Defines thickness of the line.

dashArrayList<int>?#defaultnull

Defines dash effect of the line.

it is a circular array of dash offsets and lengths. For example, the array [5, 10] would result in dashes 5 pixels long followed by blank spaces 10 pixels long.

imageImage?#defaultnull

Use it for any kind of image, to draw it in left side of the chart.

sizedPictureSizedPicture?#defaultnull

Use it for vector images, to draw it in left side of the chart.

strokeCapStrokeCap#defaultStrokeCap.butt

if not drawing dash line, then this is the StrokeCap for the line. i.e. if the two ends of the line is round or butt or square.

VerticalLine​

xdouble#required

Draws from bottom to top of the chart using the x value.

labelVerticalLineLabel?#defaultVerticalLineLabel()

Draws a text label over the line.

colorColor?#defaultnull

Defines color of the line.

Defaults to Colors.black if neither color nor gradient is provided.

gradientGradient?#defaultnull

Defines the gradient of the line.

strokeWidthdouble#default2

Defines thickness of the line.

dashArrayList<int>?#defaultnull

Defines dash effect of the line.

it is a circular array of dash offsets and lengths. For example, the array [5, 10] would result in dashes 5 pixels long followed by blank spaces 10 pixels long.

imageImage?#defaultnull

Use it for any kind of image, to draw it in bottom side of the chart.

sizedPictureSizedPicture?#defaultnull

Use it for vector images, to draw it in bottom side of the chart.

strokeCapStrokeCap#defaultStrokeCap.butt

if not drawing dash line, then this is the StrokeCap for the line. i.e. if the two ends of the line is round or butt or square.

SizedPicture​

picturePicture#required

Is the showing image.

widthint#required

width of our picture.

heightint#required

height of our picture.

HorizontalLineLabel​

paddingEdgeInsetsGeometry#defaultconst EdgeInsets.all(6)

Inner spaces around the drawing text.

styleTextStyle?#defaultnull

Sets style of the drawing text.

alignmentAlignment#defaultAlignment.topLeft

Aligns the text on the line.

showbool#defaultfalse

Determines showing label or not.

directionLabelDirection#defaultLabelDirection.horizontal

Determines the direction of the text.

labelResolverString Function(HorizontalLine)#defaultHorizontalLineLabel.defaultLineLabelResolver

Resolves a label for showing.

VerticalLineLabel​

paddingEdgeInsetsGeometry#defaultconst EdgeInsets.all(6)

Inner spaces around the drawing text.

styleTextStyle?#defaultconst TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14)

Sets style of the drawing text.

alignmentAlignment#defaultAlignment.bottomRight

Aligns the text on the line.

showbool#defaultfalse

Determines showing label or not.

directionLabelDirection#defaultLabelDirection.horizontal

Determines the direction of the text.

labelResolverString Function(VerticalLine)#defaultVerticalLineLabel.defaultLineLabelResolver

Resolves a label for showing.

FLHorizontalAlignment​

center#

Element shown horizontally center aligned to a given point.

left#

Element shown on the left side of the given point.

right#

Element shown on the right side of the given point.

FlErrorIndicatorData​

showbool#defaulttrue

Determines showing the error indicator or not

painterFlSpotErrorRangePainter Function(T)#default_defaultGetSpotRangeErrorPainter

A callback that allows you to return a FlSpotErrorRangePainter per each data point (for example FlSpot in line chart)

FlErrorRange​

lowerBydouble#required

determines the lower bound of the error range, it will be subtracted from the main value. So it is non-negative and it is relative to the main value

upperBydouble#required

determines the upper bound of the error range, it will be added to the main value. So it is non-negative and it is relative to the main value

AxisSpotIndicator​

xdouble?#defaultnull

The x value where the indicator is drawn.

ydouble?#defaultnull

The y value where the indicator is drawn.

painterAxisSpotIndicatorPainter#required

Draws the indicator, like AxisLinesIndicatorPainter (you can implement your own AxisSpotIndicatorPainter to customize it).

SideTitleAlignment​

outside#

Places the titles outside of the chart area.

border#

Places the titles on the border of the chart area.

inside#

Places the titles inside of the chart area.