Profile Picture

New Legend.PaletteLegendMode and associated functionality in 15.1

Posted By Kevin Harrison 9 Years Ago

New Legend.PaletteLegendMode and associated functionality in 15.1

Author
Message
Kevin Harrison
Question Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
Hi,

Thanks for adding this new feature.

I allow users to change the legend position from a shortcut menu on the chart. If they change, say, from right to top, the PaletteOrientation doesn't change automatically like a standard legend does.

I achieve the legend position change by having separate chart and legend panels and reorganising them. I could switch the PaletteOrientation myself but I cannot see how to get from the Chart Legend (NLegend chartLegend) to the elements on it to achieve this (as they were added using chart.DisplayOnLegend = chartLegend). Is there a way to do this?

Thanks

Kevin

PS there is a typo in the property NAutoLegend.PaleteScalePosition (missing t)

Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hi Kevin,

For an automatic legend you need to touch the palette orientation property of the NSeriesLegend for example:

someSeries.Legend.PaletteOrientation = PaletteOrientation.Horizontal;

Let us know if you meet any problems or have any questions.

Thanks for the typo tip Smile...


Best Regards,
Nevron Support Team



Kevin Harrison
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
Thanks for the reply but you didn't answer my question. I know how to change the PaletteOrientation for a series Legend, but I asked if there was any way to get to the series legends from the chart legend.

Thanks

Kevin

Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hi Kevin,

Currently there is no way to get the series that display on a legend, however you can easily loop through the chart/series in the control and check which ones display on that particular legend:

   List<NSeriesBase> seriesOnLegend = new List<NSeriesBase>();

   for (int i = 0; i < nChartControl1.Charts.Count; i++)
   {
    NChart chart = nChartControl1.Charts[i];

    for (int j = 0; j < chart.Series.Count; j++)
    {
     NSeriesBase series = chart.Series[j];

     NLegend curLegend = series.Legend.DisplayOnLegend;
     if (curLegend == null)
     {
      curLegend = chart.DisplayOnLegend;
     }

     if (curLegend == myLegend)
     {
      seriesOnLegend.Add(series);
     }
    }
   }

Hope this helps...


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic