How to show legend above axis cursors and scroll bars?


Author
Message
Vladimir Bershadsky
Vladimir Bershadsky
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
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 (159 views, 101.00 KB)
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 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
Vladimir Bershadsky
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
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


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