Pre loader

Appending data in Heatmap chart

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

0
0

Hi,
I need to append data to uniformHeatmapDataseries on each interval. So ,X Range keeps increasing ..How to append data to uniformHeatmapDataseries ?

Version
5.4.1
Images
  • You must to post comments
0
0

It’s not actually possible to append data to a heatmap, as a heatmap renders a 2-dimentional array which is a fixed size when you create the heatmap.

However, it is possible to update the heatmap array while keeping it the same size,

see https://www.scichart.com/documentation/win/current/The%20Heatmap%20Type.html

int cellHeight = 200;
int cellWidth = 300;
var data = new double[cellHeight, cellWidth];
double startX = 0;
double stepX = 1;
double startY = 0;
double stepY = 1;
var heatmapDataSeries = new UniformHeatmapDataSeries<double, double, double>(data, startX, stepX, startY, stepY);

// ...


// Update some data and force a refresh of parent chart
data[5,10] = 123.45d;
heatmapDataSeries.InvalidatateParentSurface(RangeMode.None);

Or set an entirely new array in the constructor with a different size

var data = new double[cellHeight, cellWidth];
// TODO: Fill the data[,] array with values to represent your heat values

double startX = 0;
double stepX = 1;
double startY = 0;
double stepY = 1;
var heatmapDataSeries = new UniformHeatmapDataSeries<double, double, double>(data, startX, stepX, startY, stepY);

I would recommend if you can, keeping the same size, as new array will cause frequent garbage collections.

Let me know if this helps,

Best regards,
Andrew

  • 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