Pre loader

Show Tooltip over Drawn Polygon

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

To whom this may concern:

I have a Custom Renderable Series that I use to draws a polygon around the points on a scatter plot.

protected override void Draw(IRenderContext2D renderContext, IRenderPassData renderPassData)
{
    base.Draw(renderContext, renderPassData);

    var blobShellPoints = getBlobShellPoints();

    using (var polyPen = renderContext.CreateBrush(Colors.DodgerBlue, 0.3))
    {
        var startCoordinates = getCoordinatesFor(blobShellPoints[0].X, blobShellPoints[0].Y);

        using (var blobDrawingContext = renderContext.BeginPolygon(polyPen, startCoordinates.X, startCoordinates.Y))
        {
            foreach (var point in blobShellPoints)
            {
                var pointCoords = getCoordinatesFor(point.X, point.Y);

                blobDrawingContext.MoveTo(pointCoords.X, pointCoords.Y);
            }
        }
    }
}

I would like to know if there is some way to show a tooltip when the mouse hovers over the said drawn polygon. I don’t see any ability to do this after I finish creating the polygon or before the end of the encapsulated polyPen disposable. It should look something like the attached image.

Can you please advise? Thank you kindly for your response!

P.S. I realize some of this code may be obsolete since I’m using SciChart 5. If this is only possible in 6+ then that’s understandable.

Version
5.4.0.12119
Images
  • Andrew Burnett-Thompson
    Hi Ari, hard question. You may need to override HitTest on the series as well and provide info when the xy point is inside the polygon. I will share this with the team and ask for their input.
  • Ari Sagiv
    Understandable. Meanwhile I’ll see what I can do w/ the hitpoint API.
  • You must to post comments
0
0

Hi Ari,

Thanks for your question.

I would suggest implementing the Polygon as WPF Shape. You can use ChartModifiers API for that. In fact, all our ChartModifiers that draw any overlays use WPF for this. Doing that, you will be able to use WPF capabilities to show Tooltips.

Please take a look at our documentation about custom ChartModifiers for more info.

Best regards,
Yuriy

  • Ari Sagiv
    Thank you for your response, Yuriy. I will give this a try.
  • 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