Pre loader

Heatmap width decreased after updated the UniformHeatmapDataSeries with a smaller size zValues array

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
1
0

I am implementing a heatmap. The data size of the heatmap would be changed. I update the UniformHeatmapDataSeries with the updated zValues according to this post.

https://www.scichart.com/questions/js/failed-to-update-the-zvalues-size-of-uniformheatmapdataseries-in-heatmap

There is no problem if I update the UniformHeatmapDataSeries with a larger size zValues array. However, when I update it with a smaller size zValues array, the heatmap width will be decrease (Please refer to my screenshots). How can I keep the heatmap always 100% width?

Version
3.1.333
Images
  • You must to post comments
Best Answer
0
0

Hi Quyen,

The Uniform Heatmap position, width and height is a function of the size of zValues[][] (2-dimensional) array and the xStart, xStep, yStart, yStep properties.

  • So if you have 100×100 cells and xStart = 0, xStep = 1, yStart = 0, yStep = 2 then your heatmap will occupy 0..99 in the X direction and 0…199 in the Y direction.
  • Change this to 200×200 cells with the same step then your heatmap will occupy 0..199 in the X direction and 0..399 in the Y direction

When you were creating a larger Heatmap it wasn’t correctly fitting the viewport, its probably larger than the viewport but you can’t see this because by default SciChart doesn’t zoom to fit new data unless you tell it too.

What I suggest you do is this:

  • After resizing a heatmap, call SciChartSurface.zoomExtents() to zoom to fit the new heatmap bounds.
  • This will make SciChart calculate the visibleRange of the X and Y axis to fit the new heatmap size, showing all your data

If that’s not the desired behaviour or if you want something else, let me know.

Best regards
Andrew

  • Quyen Sy
    Thank Andrew! SciChartSurface.zoomExtents() fixed my problem.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies