Back to Fl Chart

RadarChart

repo_files/documentations/radar_chart.md

1.2.05.7 KB
Original Source

RadarChart

How to use

dart
RadarChart(
  RadarChartData(
    // read about it in the RadarChartData section
  ),
  swapAnimationDuration: Duration(milliseconds: 150), // Optional
  swapAnimationCurve: Curves.linear, // Optional
);

Implicit Animations

When you change the chart's state, it animates to the new state internally (using implicit animations). You can control the animation duration and curve using optional swapAnimationDuration and swapAnimationCurve properties, respectively.

RadarChartData

PropNameDescriptiondefault value
dataSetslist of RadarDataSet that is shown on the radar chart[]
radarBackgroundColorThis property fills the background of the radar with the specified color.Colors.transparent
radarShapethe shape of the border and backgroundRadarShape.circle
radarBorderDatashows a border for radar chartBorderSide(color: Colors.black, width: 2)
getTitleThis function helps the radar chart to draw titles outside the chart. The default angle provided when called is making the title tangent to the radar chart.null
titleTextStyleTextStyle of the titlesTextStyle(color: Colors.black, fontSize: 12)
titlePositionPercentageOffsetthis field is the place of showing title on the RadarChart. The higher the value of this field, the more titles move away from the chart. this field should be between 0 and 1.0.2
tickCountDefines the number of ticks that should be paint in RadarChart1
ticksTextStyleTextStyle of the tick titlesTextStyle(fontSize: 10, color: Colors.black)
tickBorderDataStyle of the tick bordersBorderSide(color: Colors.black, width: 2)
gridBorderDataStyle of the grid bordersBorderSide(color: Colors.black, width: 2)
radarTouchDataRadarTouchData handles the touch behaviors and responses.RadarTouchData()
isMinValueAtCenterIf true, the minimum value of the [RadarChart] will be at the center of the chart.false

RadarDataSet

PropNameDescriptiondefault value
dataEntriesEach RadarDataSet contains list of RadarEntries that is shown in RadarChart.[]
fillColorfills the DataSet with the specified color.Colors.black12
fillGradientfills the DataSet with the specified gradient colors.null
borderColorPaint the DataSet border with the specified color.Colors.blueAccent
borderWidthdefines the width of RadarDataSet border.2.0
entryRadiusdefines the radius of each RadarEntries .5.0

RadarEntry

PropNameDescriptiondefault value
valueRadarChart uses this field to render every point in chart.null

RadarTouchData (read about touch handling)

PropNameDescriptiondefault value
enableddetermines to enable or disable touch behaviorstrue
mouseCursorResolveryou can change the mouse cursor based on the provided FlTouchEvent and RadarTouchResponseMouseCursor.defer
touchCallbacklisten to this callback to retrieve touch/pointer events and responses, it gives you a FlTouchEvent and RadarTouchResponsenull
longPressDurationallows to customize the duration of the longPress gesture. If null, the duration of the longPressGesture is kLongPressTimeoutnull
touchSpotThresholdthe threshold of the touch accuracy. we find the nearest spots on touched position based on this field.10

RadarTouchResponse

PropNameDescriptiondefault value
touchLocationthe location of the touch event in the device pixels coordinatesrequired
touchedSpotthe RadarTouchedSpot that user touchednull

RadarTouchedSpot

PropNameDescriptiondefault value
touchedDataSetthe RadarDataSet that user touchednull
touchedDataSetIndexindex of the RadarDataSet that user touchednull
touchedRadarEntrythe RadarEntry that user touchednull
touchedRadarEntryIndexindex of the RadarEntry that user touchednull

RadarChartTitle

PropNameDescriptiondefault value
textthe text of the titlerequired
childrenA list of InlineSpan that you can provide to have different texts with different styels. Just like how TextSpan worksnull
anglethe angle used to rotate the title (in degree)0
positionPercentageOffsetthis field is the place of showing title. The higher the value of this field, the more titles move away from the chart. this field should be between 0 and 1null

some samples


Sample 1 (Source Code)