Hi Experts,
I have a TriangulatedSurface Chart with a legend with custom colouring and I just want to change the text of the first legend entry ("-1000,00 - 0,00") of the chart below to "NaN":
The Chart legend has been setup with the following:
NLegendItemCellData legendItemCellData = null;
NLegend oLegend = _oLegend;
oLegend.Data.Items.Clear();
oLegend.Mode = LegendMode.Automatic; //Manual Mode doesnt quite work
nSeries.AutomaticPalette = false;
nSeries.Palette.Clear();
//first Palette entry is NaN
nSeries.Palette.Add(-1000, Color.White);
legendItemCellData = new NLegendItemCellData();
legendItemCellData.Text = "NaN";
legendItemCellData.MarkFillStyle = new NColorFillStyle(Color.White);
legendItemCellData.MarkShape = LegendMarkShape.Rectangle;
legendItemCellData.MarkLineStyle = new NStrokeStyle(Color.White);
oLegend.Data.Items.Add(legendItemCellData);
foreach (double f in _PlotData.ColorPalette.Keys) {
Color oColor = _PlotData.ColorPalette[f];
nSeries.Palette.Add(f, oColor);
legendItemCellData = new NLegendItemCellData();
//legendItemCellData.
legendItemCellData.Text = "> " + f.ToString("G4"); //in Automatic Mode Ignored
legendItemCellData.MarkFillStyle = new NColorFillStyle(oColor);
legendItemCellData.MarkShape = LegendMarkShape.Rectangle;
legendItemCellData.MarkLineStyle = new NStrokeStyle(Color.White);
oLegend.Data.Items.Add(legendItemCellData);
}
The only way I have found is to set the legend to Manual mode ( oLegend.Mode = LegendMode.Manual) - but this is somehow awkward since I cant get the ManualMode running in the way I want - besides I have togenerate the text for the ranges then manual as well - but I am quite satisfied with the automatic text for the label.
So is there a way to change just the first text entry of the legend after the legend has been created in Automatic-Mode?
Thanks for your help,
Joern