VizContainer

interface VizContainer

A VizContainer allows to create superposed Viz with the sames size through the newViz function.

The VizContainer is bound to a platform element (Pane for JFX, Div for JS).

The size of the VizContainer is synchronized with the size of its underlying platform element. The VizContainer takes the size of the platform element when it's created. Later modification of size must be done through the size property of the VizContainer (and not by modifying the underlying platform element), the underlying platform size is then modified accordingly.

A VizContainer is mandatory to create a chart. The VizContainer holds the charting visualization(s). Depending on the configuration one chart can generate one or two visualizations to optimize rendering performances.

You can create a VizContainer from a platform element , using the newVizContainer extension function.

See also

io.data2viz.charts.chart.VizContainer.chart

Linked to a platform element that can hold multiple canvas.

Functions

newViz
Link copied to clipboard
common
abstract fun newViz(init: Viz.() -> Unit = {}): Viz
Creates a new Viz inside the platform element.

Properties

size
Link copied to clipboard
common
abstract var size: Size
The size of this VizContainer, on change updates the underlying platform element and the existing canvas.

Extensions

chart
Link copied to clipboard
common
fun <DOMAIN> VizContainer.chart(data: List<DOMAIN>, config: ChartConfig = configuration { }, init: Chart<DOMAIN>.() -> Unit): Chart<DOMAIN>
Builds a Chart using this VizContainer.