The VizContainer

The VizContainer is a component created to simplify the bootstrapping of your charts on any platform. It is mandatory to create a chart.

The VizContainer holds the charting visualization(s) and is bound to different platform elements:

The VizContainer takes the size of the platform element when it's created. Latter modification of size must be done through the size property of the VizContainer and not by modifying the underlying platform element.

Performance mode (dual canvas)

Charts-kt offers a "performance mode" you can enable simply on every chart you create:

//run highlight-only
chart(data) {

    performanceMode = true

    (...)
}

When enabling it, the VizContainer creates and holds 2 Canvas components for the chart. One is for drawing the "front" visuals of your chart and the other for the "back".

The different layers are stored as follow:

Dual canvas and layers

<aside> 👨‍🎓 Find more information about the concept of layers.

</aside>

When enabling performance mode and using 2 Canvas, the layers are split between the two:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/252ee978-59c4-41e7-800b-35ae498c9302/Untitled.png

From bottom to top: