SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

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.