Hi,
I’m building a chart with Candlestick data and I’d like to show a heatmap background under the candles (orderflow / volume-by-price style visualization).
Right now I have a working but ugly workaround:
I take my candlestick series (which has timestamps on the X axis)
I convert all timestamps to a simple numeric index (0, 1, 2, …)
I use those numeric indexes both for the candlestick series and for the heatmap, so that they line up
This works, but it’s not great for several reasons:
Candlestick data is naturally time-based (UNIX timestamp / Date) and I’d like to keep using a CategoryDateAxis / DateTimeAxis instead of an artificial numeric axis.
I’m worried about performance and maintainability: converting back and forth between timestamps and indexes adds an extra mapping layer and makes the code more complex.
With indexes, handling gaps in time (weekends, missing candles, etc.) becomes less intuitive than using the real timestamps.
- geppetto cruciani asked 5 months ago
- last edited 4 months ago
- You must login to post comments
Hi
If your x data is continuous and evenly spaced, it should be possible to align your heatmap to the candleStick timestamp data by using the xStart, xStep, yStart, yStep properties of the UniformHeatmapDataSeries. See https://www.scichart.com/documentation/js/v4/typedoc/classes/uniformheatmapdataseries.html
The other option would be to use a second set of hidden axes for the heatmap, and then you just have to synchronise the visible Ranges, rather than every individual value. Trying to sync a numeric with a category axis is non-trivial (as the category axis range is in terms of index not value) but it can be done, and is still less conversions than the per-point method you currently have.
In the upcoming v5 we are adding a new axis type which is hybrid of Numeric and Category axis (called IndexAxis for legacy reasons). This allows you to collapse gaps like a category axis, but also position data by value like a numeric axis. Essentially we are doing value to index calculation internally, with interpolation.
Regards
David
- David Burleigh answered 4 months ago
- You must login to post comments
Please login first to submit.

