SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

Hi,
Since sometimes the rollover cursor and the points tooltips are going below the legend panel, I would like to know if there is a way to change the drawing order of the legend panel (ZIndex?).

After some tries I just managed to change the ZIndex of the LegendPlaceholder, but in this way (putting -1 as ZIndex) the legend panel will also go below the axis bands and grid lines (see attached image)

Version
4.2.2.9777
Images
  • You must to post comments
0
0

After some other tries I found a solution that works, but maybe it’s not the best one (I removed the legend placeholder from its original place, which was the root grid, and I moved it in the Modifier Surface, applying a ZIndex):

MainGrid mainGrid = ParentSurface?.RootGrid as MainGrid;
if (mainGrid != null)
{
    LegendPlaceholder holder = VisualTreeFinder.FindChildControl<LegendPlaceholder>(mainGrid);
    Canvas canvas = VisualTreeFinder.FindChildControl<Canvas>(ModifierSurface as ChartModifierSurface);

    if (holder != null && canvas != null)
    {
        mainGrid.Children.Remove(holder);
        canvas.Children.Add(holder);
        Panel.SetZIndex(holder, -1);

        if (holder.HorizontalAlignment == HorizontalAlignment.Right)
            Canvas.SetRight(holder, 0);
        if (holder.VerticalAlignment == VerticalAlignment.Bottom)
            Canvas.SetBottom(holder, 0);
    }
}

Please let me know if you have a better solution
Thanks

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.