Profile Picture

Changing Legend entry text for TriangulatedSurfaceSeries

Posted By joern kunze 9 Years Ago

Changing Legend entry text for TriangulatedSurfaceSeries

Author
Message
joern kunze
Posted 9 Years Ago
View Quick Profile
Junior Member

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
Last Active: 2 Years Ago
Posts: 86, Visits: 218
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
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
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





Similar Topics


Reading This Topic