Pre loader

Stay-open ToolTip modifier

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

Hi all. I would like to add tooltips to my chart, but have them behave a bit differently than they do by default. Specifically, they should

  1. Appear on left-click rather than on hover
  2. Stay open until the user clicks outside them (or the mouse leaves the chart area)
  3. Not appear if another ToolTip is already open (mostly follows from #2)

The existing ToolTipModifier can give me #1, but not #2 or #3, as far as I can tell.

So what’s the best way for me to implement this behavior? Can I get to it by subclassing the existing ToolTipModifier, or do I need to start from scratch? And if deriving is the answer, what would I need to override?

My motivation is that I would like to place buttons/hyperlinks in the tooltip for performing actions related to the clicked datapoint, so if there are completely different ways to achieve this that don’t involve tooltips at all, I’m open to suggestions.

Version
5.2.0.11680
  • David La Fleur
    Upon further thought, maybe it makes more sense to do this with a custom annotation?
  • You must to post comments
0
0

I think this might require a code-change to achieve, or a totally custom modifier.

The RolloverModifier.HandleMasterMouseEvent method has this code:

    protected override void HandleMasterMouseEvent(Point mousePoint)
    {         
        if (ShowTooltipOn == ShowTooltipOptions.MouseHover && PointUtil.Distance(mousePoint, _lastMouseMovePoint) >= HOVER_EPSILON)
        {
            ClearTooltipLabels();
            _lastMouseMovePoint = mousePoint;
        }
       // ... 
   } 

This is where we decide when to show the tooltip depending on ShowTooltipOn option.

To modify that you’d need to a.) have access to our source code and b.) inherit the RolloverModifier and change that behaviour of when tooltips are shown.

Other alternatives include:

  1. Creating a custom modifier from scratch, e.g. see Custom ChartModifiers – Part 1 – Creating a Custom Rollover Modifier
  2. Or two, yes trying other techniques such as annotations

There is a sandbox application with custom modifier examples over at github.

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies