Skip to content

AreaPlot

Overview

AreaPlot is a plot that combines a line plot and a bar plot. An area plot is distinguished from a line plot by the addition of shading between lines and a baseline, like in a bar plot.

Null values are skipped and allow you to create separate shaded regions.

@author Martin Veillette

Class AreaPlot

import { AreaPlot } from 'scenerystack/bamboo';

Constructor

new AreaPlot( chartTransform : ChartTransform, dataSet : AreaChartDataSet, providedOptions? : AreaChartOptions )

Instance Methods

dispose()

update()

Recomputes the rendered shape.

setDataSet( dataSet : AreaChartDataSet )

Sets the dataSet and redraws the plot. If instead the dataSet array is mutated, it is the client's responsibility to call update or make sure update is called elsewhere (say, if the chart scrolls in that frame).

setBaseline( baseline : number )

Sets the baseline value for the area plot.

Instance Properties

dataSet : AreaChartDataSet

if you change this directly, you are responsible for calling update

baseline : number

a y-value that serves as foundation for the area plot.

Type AreaChartDataSet

import type { AreaChartDataSet } from 'scenerystack/bamboo';

( Vector2 | null )[]

Type AreaChartOptions

import type { AreaChartOptions } from 'scenerystack/bamboo';

Source Code

See the source for AreaPlot.ts in the bamboo repository.