Hello,
I have implemented a custom Chartmodifier:
http://support.scichart.com/index.php?/Knowledgebase/Article/View/17255/32/custom-chartmodifiers—part-6—select-data-points-via-mouse-drag
Now I want to highligt(for example other Color) the line between the Start and Endpoint.
How can I do this?
- Daniel Hartl asked 9 years ago
- You must login to post comments
Hi Daniel,
There are two places where we draw to the screen during the custom Data-Point Selection ChartModifier:
- The first is private Point SetReticulePosition(Rectangle rectangle, Point startPoint, Point endPoint, bool isMaster)
- The second is public override void OnParentSurfaceRendered(SciChartRenderedMessage e)
During SetReticulePosition, we are using the ModifierSurface – a WPF Canvas on top of the chart – to position a simple UIElement. If you wanted to add a Line here you can do also.
During OnParentSurfaceRendered, we draw the points for selection after the user has released the mouse. Here we use SciChart’s bitmap drawing engine to draw ellipses. Other methods available on IRenderContext2D include
- DrawLine – lines of variable stroke width
- DrawQuad – draw a rectangle
- DrawEllipse – draw an ellipse shape
- CreateBrush – Create a brush for fills
- CreatePen – Create a Pen for drawing lines
- CreateSprite – Create a Sprite for drawing repeated small bitmaps
- FillPolygon – Fill an area with a brush
- FillRectangle – Fill a rectangle area
- FillEllipse – Fill an ellipse shape
- DrawText – Draw some text to the render surface
If you use one of these two you can draw to the chart surface during the modifier operation.
Hope that helps,
Andrew
- Andrew Burnett-Thompson answered 9 years ago
- You must login to post comments
Please login first to submit.