LineChartBarData class
Holds data for drawing each individual line in the LineChart
Constructors
-
LineChartBarData({List<
FlSpot> spots = const [], bool show = true, Color? color, Gradient? gradient, double barWidth = 2.0, bool isCurved = false, double curveSmoothness = 0.35, bool preventCurveOverShooting = false, double preventCurveOvershootingThreshold = 10.0, bool isStrokeCapRound = false, bool isStrokeJoinRound = false, BarAreaData? belowBarData, BarAreaData? aboveBarData, FlDotData dotData = const FlDotData(), List<int> showingIndicators = const [], List<int> ? dashArray, Shadow shadow = const Shadow(color: Colors.transparent), bool isStepLineChart = false, LineChartStepData lineChartStepData = const LineChartStepData()}) -
BarChartdraws some lines and overlaps them in the chart's view, You can have multiple lines by splitting them, put aFlSpot.nullSpotbetween each section. each line passes throughspots, with hard edges by default,isCurvedmakes it curve for drawing, andcurveSmoothnessdetermines the curve smoothness.
Properties
- aboveBarData → BarAreaData
-
Fills the space above the line, using a color or gradient.
final
- barWidth → double
-
Determines thickness of drawing line.
final
- belowBarData → BarAreaData
-
Fills the space blow the line, using a color or gradient.
final
- color → Color?
-
If provided, this LineChartBarData draws with this color
Otherwise we use gradient to draw the background.
It throws an exception if you provide both color and gradient
final
- curveSmoothness → double
-
If isCurved is true, it determines smoothness of the curved edges.
final
-
dashArray
→ List<
int> ? -
Determines the dash length and space respectively, fill it if you want to have dashed line.
final
- dotData → FlDotData
-
Responsible to showing spots on the line as a circular point.
final
- gradient → Gradient?
-
If provided, this LineChartBarData draws with this gradient.
Otherwise we use color to draw the background.
It throws an exception if you provide both color and gradient
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCurved → bool
-
If it's true,
LineChartdraws the line with curved edges, otherwise it draws line with hard edges.final - isStepLineChart → bool
-
If sets true, it draws the chart in Step Line Chart style, using LineChartBarData.lineChartStepData.
final
- isStrokeCapRound → bool
-
Determines the style of line's cap.
final
- isStrokeJoinRound → bool
-
Determines the style of line joins.
final
- lineChartStepData → LineChartStepData
-
Holds data for representing a Step Line Chart, and works only if
isStepChartis true.final - mostBottomSpot ↔ FlSpot
-
We keep the most bottom spot to prevent redundant calculations
latefinal
- mostLeftSpot ↔ FlSpot
-
We keep the most left spot to prevent redundant calculations
latefinal
- mostRightSpot ↔ FlSpot
-
We keep the most right spot to prevent redundant calculations
latefinal
- mostTopSpot ↔ FlSpot
-
We keep the most top spot to prevent redundant calculations
latefinal
- preventCurveOverShooting → bool
-
Prevent overshooting when draw curve line with high value changes.
check this issue
final
- preventCurveOvershootingThreshold → double
-
Applies threshold for preventCurveOverShooting algorithm.
final
-
props
→ List<
Object?> -
Used for equality check, see
EquatableMixin.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadow → Shadow
-
Drops a shadow behind the bar line.
final
- show → bool
-
Determines to show or hide the line.
final
-
showingIndicators
→ List<
int> -
Show indicators based on provided indexes
final
-
spots
→ List<
FlSpot> -
This line goes through this spots.
final
- stringify → bool?
-
If set to
true, the toString method will be overridden to output this instance's props.no setterinherited
Methods
-
copyWith(
{List< FlSpot> ? spots, bool? show, Color? color, Gradient? gradient, double? barWidth, bool? isCurved, double? curveSmoothness, bool? preventCurveOverShooting, double? preventCurveOvershootingThreshold, bool? isStrokeCapRound, bool? isStrokeJoinRound, BarAreaData? belowBarData, BarAreaData? aboveBarData, FlDotData? dotData, List<int> ? dashArray, List<int> ? showingIndicators, Shadow? shadow, bool? isStepLineChart, LineChartStepData? lineChartStepData}) → LineChartBarData - Copies current LineChartBarData to a new LineChartBarData, and replaces provided values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
lerp(
LineChartBarData a, LineChartBarData b, double t) → LineChartBarData -
Lerps a LineChartBarData based on
tvalue, check Tween.lerp.