Hi Joern,
Most likely the line series is beneath the heatmap - we tested with the following code and it was working properly:
private void Form1_Load(object sender, EventArgs e)
{
// 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.Blue);
// 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);
}
}
}
NLineSeries line = new NLineSeries();
chart.Series.Insert(0, line);
line.Name = "ReferenceLine";
line.UseXValues = true;
line.MarkerStyle.Visible = false;
line.DataLabelStyle.Visible = false;
line.InflateMargins = false;
line.BorderStyle.Color = Color.Cyan;
line.BorderStyle.Width = new NLength(2, NPointGraphicsUnit.Point);
for (int i = 0; i < 100; i++)
{
line.Values.AddRange(i);
line.XValues.AddRange(i);
}
// Create a rounded rect callout
NRectangularCallout rectangularCallout = new NRectangularCallout();
rectangularCallout.Text = "Test";
rectangularCallout.UseAutomaticSize = true;
// Anchor the callout to data point #0 of the line series
NDataPointAnchor anchor = new NDataPointAnchor(line, 1, ContentAlignment.MiddleCenter, StringAlignment.Center);
rectangularCallout.Anchor = anchor;
rectangularCallout.AlwaysInsideParent = true;
chart.ChildPanels.Add(rectangularCallout);
}
Note that the code changed to insert the line series at the first place in the collection:
NLineSeries line = new NLineSeries();
chart.Series.Insert(0, line);
instead of adding it at the back.
Hope this helps - let us know if you meet any problems or have any questions.
Best Regards,
Nevron Support Team