Compare charts
Use compare charts to display multiple instrument series on a single chart and visualize their percentage-based performance.
In chart-core, you can add multiple candle series to the same chart using the compare charts feature.
This is useful for comparing different instruments on a percentage Y scale.
To add compare series, refer to ChartComponent API.
Percent Y-axis baseline
When the Y-axis is set to percent scale, the chart uses the close price of the first candle in the viewport as the baseline (0%).
All prices on the axis are shown as percentage change relative to that baseline:
percent = (price - baseline) * 100 / baseline
The 0% line aligns with the baseline close. When you pan or zoom the chart, the first visible candle changes, so the baseline and 0% line update accordingly.
This applies to the main series and to compare series on a shared percentage Y-axis.