Chart class
Interactive chart widget.
- Inheritance
Constructors
-
Chart({required DataSeries<
Tick> mainSeries, required int granularity, required CrosshairVariant crosshairVariant, InteractiveLayerBehaviour? interactiveLayerBehaviour, DrawingTools? drawingTools, int pipSize = 4, ChartController? controller, List<IndicatorConfig> ? overlayConfigs, List<IndicatorConfig> bottomConfigs = const <IndicatorConfig>[], MarkerSeries? markerSeries, ChartTheme? theme, VoidCallback? onCrosshairAppeared, VoidCallback? onCrosshairDisappeared, OnCrosshairHoverCallback? onCrosshairHover, VisibleAreaChangedCallback? onVisibleAreaChanged, VisibleQuoteAreaChangedCallback? onQuoteAreaChanged, bool isLive = false, bool dataFitEnabled = false, double opacity = 1.0, List<ChartAnnotation< ? annotations, ChartAxisConfig chartAxisConfig = const ChartAxisConfig(), ChartTimeConfig chartTimeConfig = const ChartTimeConfig(), bool showCrosshair = false, Repository<ChartObject> >IndicatorConfig> ? indicatorsRepo, double? msPerPx, double? minIntervalWidth, double? maxIntervalWidth, EdgeInsets? dataFitPadding, Duration? currentTickAnimationDuration, Duration? quoteBoundsAnimationDuration, bool? showCurrentTickBlinkAnimation, double? verticalPaddingFraction, EdgeInsets? bottomChartTitleMargin, bool? showDataFitButton, bool? showScrollToLastTickButton, Color? loadingAnimationColor, bool useDrawingToolsV2 = false, bool magnetEnabled = false, Key? key}) -
Creates chart that expands to available space.
const
Properties
-
annotations
→ List<
ChartAnnotation< ?ChartObject> > -
Chart's annotations
final
- bottomChartTitleMargin → EdgeInsets?
-
Specifies the margin to prevent overlap.
final
-
bottomConfigs
→ List<
IndicatorConfig> -
List of bottom indicator series to add on chart separate from the
mainSeries.
final
- chartAxisConfig → ChartAxisConfig
-
Configurations for chart's axes.
final
- chartTimeConfig → ChartTimeConfig
-
Configuration for how chart timestamps are displayed (timezone, custom
label formatting for the x-axis and crosshair).
final
- controller → ChartController?
-
Chart's controller
final
- crosshairVariant → CrosshairVariant
-
The variant of the crosshair to be used.
This is used to determine the type of crosshair to display.
The default is CrosshairVariant.smallScreen.
CrosshairVariant.largeScreen is mostly for web.
final
- currentTickAnimationDuration → Duration?
-
Duration of the current tick animated transition.
final
- dataFitEnabled → bool
-
Starts in data fit mode and adds a data-fit button.
final
- dataFitPadding → EdgeInsets?
-
Padding around data used in data-fit mode.
final
- drawingTools → DrawingTools?
-
Keep the reference to the drawing tools class for
sharing data between the AcmeChart and the DrawingToolsDialog
final
- granularity → int
-
For candles: Duration of one candle in ms.
For ticks: Average ms difference between two consecutive ticks.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
indicatorsRepo
→ Repository<
IndicatorConfig> ? -
Chart's indicators
final
- interactiveLayerBehaviour → InteractiveLayerBehaviour?
-
The interactive layer behaviour.
final
- isLive → bool
-
Whether the chart should be showing live data or not.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingAnimationColor → Color?
-
The color of the loading animation.
final
- magnetEnabled → bool
-
Whether new drawing tool points snap to the nearest candle's time
bucket instead of the exact cursor position ("magnet" mode).
final
-
mainSeries
→ DataSeries<
Tick> -
Chart's main data series.
final
- markerSeries → MarkerSeries?
-
Open position marker series.
final
- maxIntervalWidth → double?
-
Specifies the maximum interval width
that is used for calculating the maximum msPerPx.
final
- minIntervalWidth → double?
-
Specifies the minimum interval width
that is used for calculating the maximum msPerPx.
final
- msPerPx → double?
-
Specifies the zoom level of the chart.
final
- onCrosshairAppeared → VoidCallback?
-
Called when crosshair details appear after long press.
final
- onCrosshairDisappeared → VoidCallback?
-
Called when the crosshair is dismissed.
final
- onCrosshairHover → OnCrosshairHoverCallback?
-
Called when the crosshair cursor is hovered/moved.
final
- onQuoteAreaChanged → VisibleQuoteAreaChangedCallback?
-
Callback provided by library user.
final
- onVisibleAreaChanged → VisibleAreaChangedCallback?
-
Called when chart is scrolled or zoomed.
final
- opacity → double
-
Chart's opacity, Will be applied on the mainSeries.
final
-
overlayConfigs
→ List<
IndicatorConfig> ? -
List of overlay indicator series to add on chart beside the mainSeries.
final
- pipSize → int
-
Number of digits after decimal point in price.
final
- quoteBoundsAnimationDuration → Duration?
-
Duration of quote bounds animated transition.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showCrosshair → bool
-
Whether the crosshair should be shown or not.
final
- showCurrentTickBlinkAnimation → bool?
-
Whether to show current tick blink animation or not.
final
- showDataFitButton → bool?
-
Whether the data fit button is shown or not.
final
- showScrollToLastTickButton → bool?
-
Whether to show the scroll to last tick button or not.
final
- theme → ChartTheme?
-
Chart's theme.
final
- useDrawingToolsV2 → bool
-
Whether to use new drawing tools or not.
final
- verticalPaddingFraction → double?
-
Fraction of the chart's height taken by top or bottom padding.
Quote scaling (drag on quote area) is controlled by this variable.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StatefulWidget> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited