Trendline class

Renders the chart trendline.

A trendline is a straight line that connects two or more price points and then extends into the future to act as a line of support. Trendlines provide support for forward and backward forecastings.

Provides option to customize the trendline types, width, forwardForecast and backwardForecast.

Constructors

Trendline({bool enableTooltip = true, double? intercept, String? name, List<double>? dashArray, Color color = Colors.blue, TrendlineType type = TrendlineType.linear, double backwardForecast = 0, double forwardForecast = 0, double opacity = 1, bool isVisible = true, double width = 2, double animationDuration = 1500, double? animationDelay = 0, String valueField = 'high', bool isVisibleInLegend = true, LegendIconType legendIconType = LegendIconType.horizontalLine, MarkerSettings markerSettings = const MarkerSettings(), int polynomialOrder = 2, int period = 2, ChartTrendlineRenderCallback? onRenderDetailsUpdate})
Creating an argument constructor of Trendline class.

Properties

animationDelay double?
Delay duration of the trendline animation. It takes a millisecond value as input. By default,the trendline will get animated for the specified duration. If animationDelay is specified, then the trendline will begin to animate after the specified duration.
final
animationDuration double
Determines the animation time of trendline.
final
backwardForecast double
Specifies the backward forecasting of trendlines.
final
color Color
Color of the trendline.
final
dashArray List<double>?
Pattern of dashes and gaps used to stroke the trendline.
final
enableTooltip bool
Enables the tooltip for trendlines.
final
forwardForecast double
Specifies the forward forecasting of trendlines.
final
hashCode int
The hash code for this object.
no setteroverride
intercept double?
Specifies the intercept value of the trendlines.
final
isVisible bool
Determines the visibility of the trendline.
final
isVisibleInLegend bool
Show/hides the legend for trendline.
final
legendIconType LegendIconType
Specifies the type of legend icon for trendline.
final
markerSettings MarkerSettings
Settings to configure the marker of trendline.
final
name String?
Provides the name for trendline.
final
onRenderDetailsUpdate ChartTrendlineRenderCallback?
Callback which gets called while rendering the trendline.
final
opacity double
Opacity of the trendline.
final
period int
Specifies the period for moving average trendline.
final
polynomialOrder int
Specifies the order of the polynomial for polynomial trendline.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type TrendlineType
Specifies the intercept value of the trendlines.
final
valueField String
To choose the valueField(low or high) to render the trendline.
final
width double
Width of trendlines.
final

Methods

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.
override