In this guide you'll see how to:
✔️ Synchronize the display sizes of several charts
✔️ Synchronize the cursors of several charts
✔️ Synchronize the viewport (zoom & pan) of several charts
Find a similar Javascript example code here: https://play.data2viz.io/sketches/MYnMqL/edit/
Let's have a look at this application where 3 vertically aligned charts share the same X-axis.
If you want these charts to work in perfect synchronization, you need to ensure that:
Charts-kt is a multiplatform library, so let's skip the details and say that you create your application grid-layout with the framework of your choice.
When you have your 3 container elements (Div, Pane... depending on your target platform) that are placed correctly and responsive you can create VizContainers out of them. They are sized from the base component and your charts will be displayed in it.
//run highlight-only
val root = VBox()
val paneContainer = Pane()
root.children.add(paneContainer)
val myVizContainer = paneContainer.newVizContainer()
myVizContainer.size = Size(myApplication.width, myApplication.height / 3.0)
val myChart = myVizContainer.chart(data) {
...
}