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

743 views

I was looking at the example given at this link for NonUniformHeatmapDataSeries in SciChart. In this example, the width and height of heatmap is given as h=4 and w=7. As I understand h is for Y axis and w is for X axis and data[,] is for Z axis. However, the counts in actual data filled for these axis are not matching wight h and w.

``````var xRangeMapping = new int[] { 0, 10, 20, 26, 36, 60, 72, 84 };   // 8 points for w
var yRangeMapping = new int[] { 100, 250, 390, 410, 600 };         // 5 points for h
``````

What is the purpose of extra points added at first place (0 and 100)? Are these required to set the starting point for both axis?

Here is the code given at above link:

``````int w = 7, h = 4;
var data = new double[h, w];
double maxValue = double.MinValue;
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
{
data[y, x] = 3.5 * ((h - y) * (w - x));
maxValue = Math.Max(maxValue, data[y,x]);
}
var xRangeMapping = new int[] { 0, 10, 20, 26, 36, 60, 72, 84 };
var yRangeMapping = new int[] { 100, 250, 390, 410, 600 };
var heatmapDataSeries = NonUniformHeatmapDataSeries<int, int, double>(data, i => xRangeMapping[i], i => yRangeMapping[i]);

// Apply the Heatmap DataSeries to a FastNonUniformheatmapRenderableSeries
var heatmapRenderableSeries = new FastUniformHeatmapRenderableSeries()
{
ColorMap = new HeatmapColorPalette()
{
Maximum = maxValue,
Minimum = 0,