Changing Legend entry text for TriangulatedSurfaceSeries


Author
Message
joern kunze
joern kunze
Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)
Group: Forum Members
Posts: 86, Visits: 221
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":
 https://www.nevron.com/forum/uploads/images/bc289a7c-316f-4cfe-94a5-c2eb.bmp
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
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Joern,

There is no way to change the output of the automatic legend - the only way to work around this is to use Manual mode and create the legend items from code...


Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search