Line chart widget.

Description

LineChart is a class that extends BaseSimpleChart and is used to create a line chart widget. In fact, LineChart can also be used to create a scatter chart and a bubble chart.

Hierarchy (view full)

Constructors

Properties

animationInstances: AnimationInstance<Widget>[] = []
centerX: number
centerY: number
children: Widget[] = []

The child-widgets of the widget.

The data of the LineChart.

display: boolean = true
dotSets: Circle[][]

The dot sets of the LineChart.

eventInstances: EventInstance<Widget>[] = []
fillPaint: Paint
hasSet: boolean = false
isImplemented: boolean = false
key: string = ...
last: Widget = ...
layout: ChartLayout

Layout object for the chart.

parent: Widget
paths: Path[]

The paths of the lines in the LineChart.

plugins: WidgetPlugin[] = []
progress: number
registeredEvents: Map<string, Event<Widget>> = ...
setups: {
    generator: Generator<number | {
        animation: Animation<any>;
        duration: number;
        mode: "async" | "sync";
        params: Record<string, any>;
        setAsync: (() => { animation: Animation<any>; mode: "async" | "sync"; duration: number; params: Record<string, any>; setAsync: () => ...; setSync: () => ...; });
        setSync: (() => { animation: Animation<any>; mode: "async" | "sync"; duration: number; params: Record<string, any>; setAsync: () => ...; setSync: () => ...; });
    }, void, unknown>;
    nextFrame: number;
}[] = []

Type declaration

  • generator: Generator<number | {
        animation: Animation<any>;
        duration: number;
        mode: "async" | "sync";
        params: Record<string, any>;
        setAsync: (() => { animation: Animation<any>; mode: "async" | "sync"; duration: number; params: Record<string, any>; setAsync: () => ...; setSync: () => ...; });
        setSync: (() => { animation: Animation<any>; mode: "async" | "sync"; duration: number; params: Record<string, any>; setAsync: () => ...; setSync: () => ...; });
    }, void, unknown>
  • nextFrame: number
status: Status = 'unborn'
strokePaint: Paint
strokePaints: Paint[]

The stroke paints for the lines in the LineChart.

The style of the LineChart.

updates: (<T>(elapsed, widget) => void)[] = []

Type declaration

    • <T>(elapsed, widget): void
    • Type Parameters

      Parameters

      • elapsed: number
      • widget: T

      Returns void

x: number
y: number

Accessors

  • get range(): WidgetRange
  • The range of the widget, taking into account the children, based on the parent coordinate. To be noted that this method should not be overridden.

    Returns WidgetRange

    The range of the widget.

  • get singleRange(): WidgetRange
  • The range of the widget, taking into account the children, based on the parent coordinate. To be noted that this method should not be overridden.

    Returns WidgetRange

    The range of the widget.

Methods

  • Add children widgets for the widget.

    Parameters

    • Rest ...children: Widget[] | ((parent) => Widget)[]

      The added children.

    Returns this

  • Parameters

    • animation: Animation<any>
    • startAt: number
    • duration: number
    • Optional params: Record<string, any>

    Returns this

  • Parameters

    • x: number
    • y: number

    Returns {
        x: number;
        y: number;
    }

    • x: number
    • y: number
  • Parameters

    • x: number
    • y: number

    Returns {
        x: number;
        y: number;
    }

    • x: number
    • y: number
  • Parameters

    • name: string
    • Rest ...args: any[]

    Returns this

  • Determine whether the point is in the widget, based on the parent coordinate. To be noted that this method should not be overridden.

    Parameters

    • x: number
    • y: number

    Returns boolean

  • Parameters

    • event: string | Event<Widget>
    • effect: ((widget, ...args) => any)
        • (widget, ...args): any
        • Parameters

          • widget: Widget
          • Rest ...args: any[]

          Returns any

    Returns this

  • Called when the parameters are changed.

    Parameters

    • ck: CanvasKit

      The namespace of CanvasKit-WASM.

    • Optional propertyChanged: string

    Returns void

  • Parameters

    • elapsed: number
    • ck: CanvasKit

    Returns void

  • Parameters

    • element: HTMLCanvasElement

    Returns void

  • Set up an update function to call it when the widget is changed.

    Parameters

    • updateFunc: (<T>(elapsed, widget) => void)

      The frame from having gone to current frame.

        • <T>(elapsed, widget): void
        • Type Parameters

          Parameters

          • elapsed: number
          • widget: T

          Returns void

    Returns this

  • Update the object according to the style of the widget. Called when the style is changed.

    Parameters

    • canvas: Canvas

      The canvas object of CanvasKit-WASM.

    Returns void

  • Parameters

    • widget: Widget
    • x: number
    • y: number

    Returns {
        x: number;
        y: number;
    }

    • x: number
    • y: number
  • Parameters

    Returns {
        x: number;
        y: number;
    }

    • x: number
    • y: number