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.
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
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