Profile Picture

How to show legend above axis cursors and scroll bars?

Posted By Vladimir Bershadsky 11 Years Ago
Author
Message
Vladimir Bershadsky
Posted 11 Years Ago
View Quick Profile
Junior Member

Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 15, Visits: 1

Hi,

Is it possible to show legend above axis cursors and scroll bars?

Attached picture illustrates the problem in question.

Thank you in advance,

Vladimir.

 



Attachments
LegendZOrder.jpg (141 views, 101.00 KB)
Nevron Support
Posted 11 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 Vladimir,

No - for performance reasons scrollbars and cursors are rendered in overlay, which means that they'll appear in front of all other objects. One way to resolve this issue is to position the legend in the chart plot bounds, not in the chart area - that way it will not overlap the scrollbars - the following example shows how to achieve this:

   nChartControl1.Panels.Clear();

   NCartesianChart chart = new NCartesianChart();
   chart.PositionChildPanelsInContentBounds = true;
   nChartControl1.Panels.Add(chart);

   NLegend legend = new NLegend();
   legend.Margins = new NMarginsL(10);
   chart.ChildPanels.Add(legend);

   chart.DisplayOnLegend = legend;

The idea is that the legend must be a child panel of the chart and the chart must be configured to position child panels inside the content bounds. Hope this helps - let us know if you have any questions.



Best Regards,
Nevron Support Team



Vladimir Bershadsky
Posted 11 Years Ago
View Quick Profile
Junior Member

Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 15, Visits: 1

Thank you for answer.

If I make legend a child panel of the chart, can I still use Select and Offset tools, so users can easily drag legend within the chart? I made changes from your code sample and it seems like I can't drag legend anymore. Am I missing something?

Regards,

Vladimir





Similar Topics


Reading This Topic