ChartTypeBuilder

Chart type builder for switching and retrieving the chart type. Supports various chart types including table, bar, line, pie, scatter, and more.

Properties

Methods

constructor

Constructor

Definition:

constructor(doc: Y.Doc, dsl: Y.Map<any>)

Parameters:

ParameterTypeDescription
docY.Doc-
dslY.Map-

observe

Listens for chart type changes.

Definition:

observe(callback: ObserveCallback): () => void

Returns: () => void

Parameters:

ParameterTypeDescription
callbackObserveCallback- Callback function

changeChartType

Sets the chart type.

Definition:

changeChartType(chartType: string)

Parameters:

ParameterTypeDescription
chartTypestring- Chart type

getChartType

Gets the current chart type.

Definition:

getChartType(): string

Returns: string

getSupportedDimensionEncodings

Gets the dimension encodings supported by the current chart type.

Definition:

getSupportedDimensionEncodings()

getRecommendedDimensionEncodings

Returns recommended dimension encodings in order based on the current chart type.

Definition:

getRecommendedDimensionEncodings(dimensionCount: number)

Parameters:

ParameterTypeDescription
dimensionCountnumber- Number of dimensions; defaults to the dimension count in the current DSL

getSupportedMeasureEncodings

Gets the measure encodings supported by the current chart type.

Definition:

getSupportedMeasureEncodings()

getRecommendedMeasureEncodings

Returns recommended measure encodings in order based on the current chart type.

Definition:

getRecommendedMeasureEncodings(measureCount: number)

Parameters:

ParameterTypeDescription
measureCountnumber- Number of measures; defaults to the measure count in the current DSL

toJSON

Exports to JSON.

Definition:

toJSON(): string

Returns: string

getAvailableChartTypes

Gets all supported chart types.

Definition:

getAvailableChartTypes(): string[]

Returns: string[]