Charts-kt manages several layers of display and gives the visual elements the expected "drawing zone" in the expected layer, so you don't have to handle this yourself.
This is a view of a Chart layers:
Each visual element drawing is restricted to a given layer, this ensures that, for example, the axes can't be hidden by the marks as they are always on top of them.
For the sake of simplification the schema displayed only a single "mark layer", but there are 4 of them for each Mark in the chart:
Keep in mind that drawing on a layer (for example when you draw a highlighted mark on the marks top layer) does not clear the other layers.
As for the marks, there are as many axis layer as axes displayed in the chart.
This layer is used to draw background elements like the "alternate backgrounds", or the "grid lines" to increase the readability of your chart.
The chart background layer is simply filled with a solid color.
A DrawingZone
is an on-screen zone defined by its position and its size.