SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & 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!

0
0

Hi,

I want to use a CursorModifier with a TooltipContainerStyle in a SciChartSurface to display a tooltip. I would like to modify the default behavior that places the tooltip to the bottom and right of the cursor, and place the tooltip at bottom center instead.

Is this possible, and if so, how?

We are using SciChart 4.0.2.8024 in our project.

Of course, I can always use the tooltip’s ActualWidth to tweak its Margin accordingly, but I would like to know if there is a simpler solution than that, before I do this.

  • You must to post comments
0
0

Hi there,

Thanks for your inquiry. Unfortunately, we don’t provide API to change the default tooltip placement. It is possible to change it doing a little overridding though.

So you should override the HandleMasterMouseEvent method, then retrieve the tooltip from ModifierSurface and finally change its position. Please try the following code:

        protected override void HandleMasterMouseEvent(Point mousePoint)
    {
        if (ModifierSurface != null)
        {
            var tooltip = ModifierSurface.Children.OfType<CursorLabelControl>().FirstOrDefault();

            if(tooltip != null)
            {
                Canvas.SetLeft(tooltip, mousePoint.X - tooltip.ActualWidth/2);
            }
        }
    }

Please let us know if this helps,

Best regards,
Yuriy

  • You must to post comments
0
0

Hello Yuriy,

I have been busy with other things lately, but have not forgotten this issue.

I ended up implementing a fix using my first approach, but since I have now run into some problems with it, I will now try your proposal.

Thank you,
Sami

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.