SizeManager

interface SizeManager

Size manager: stores Charts' sizes and synchronizes them, the "size synchronization" concerns the size (width & height) of the "main charting zone" of all synchronized charts.

To synchronize several Charts on screen:

Let's say you want to display vertically 3 charts that use the same X-axis but display 3 different values on the Y-axis. In order to make data comparison easy, you want these charts to be perfectly aligned, even if they may have different values displayed on their Y-axes and so may not be perfectly aligned by default. To fix this use a vertical synchronizer]:

val synchronizer = SizeManager().vSynchro()
synchronizer.addAllCharts(chart1, chart2, chart3)

If one of the synchronized charts has a charting zone with a small width (for example because it displays a large Legend component on its right) then the other vertically synchronized charts will have a charting zone with the same width and at the same X position on screen.

By doing this, you can very easily synchronize Charts that shares the same values, they will be pixel-perfect synchronized even if they display different kind of data and even after being resized.

When a synchronized Chart change size, the other will also be resized according to the new constraints.

Functions

hSynchro
Link copied to clipboard
common
abstract fun hSynchro(): SizeSynchronizer
Create a horizontal synchronizer for this sizeManager.
synchronize
Link copied to clipboard
common
abstract fun synchronize()
Call the synchronization of all your synchronized charts.
vSynchro
Link copied to clipboard
common
abstract fun vSynchro(): SizeSynchronizer
Create a vertical synchronizer for this sizeManager.