Hi Joern,
You cannot pass negative values to the heatMapSeries.Data.SetValue function - the x/y values passed there must always be in the range [0, gridSize). We just tested the control with the following code:
// set a chart title
NLabel title = new NLabel("Wafer Chart");
title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
title.TextStyle.FillStyle = new NColorFillStyle(Color.AliceBlue);
// configure chart
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
NHeatMapSeries heatMap = new NHeatMapSeries();
chart.Series.Add(heatMap);
NHeatMapData data = heatMap.Data;
heatMap.Palette.Mode = PaletteMode.AutoFixedEntryCount;
heatMap.Palette.AutoPaletteColors = new NArgbColorValue[] { new NArgbColorValue(Color.Green), new NArgbColorValue(Color.Red) };
heatMap.Palette.SmoothPalette = true;
int gridSizeX = 100;
int gridSizeY = 100;
data.SetGridSize(gridSizeX, gridSizeY);
int centerX = gridSizeX / 2;
int centerY = gridSizeY / 2;
int radius = gridSizeX / 2;
Random rand = new Random();
for (int y = 0; y < gridSizeY; y++)
{
for (int x = 0; x < gridSizeX; x++)
{
int dx = x - centerX;
int dy = y - centerY;
double pointDistance = Math.Sqrt(dx * dx + dy * dy);
if (pointDistance < radius)
{
// assign value
data.SetValue(x, y, pointDistance + rand.Next(20));
}
else
{
data.SetValue(x, y, double.NaN);
}
}
}
heatMap.XValuesMode = HeatMapValuesMode.OriginAndStep;
heatMap.OriginX = -40;
heatMap.StepX = 1;
and the control was working properly. What is the version you're testing with?
Best Regards,
Nevron Support Team