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!

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.

Answered
0
0

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?

  • You must to post comments
Best Answer
1
0

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

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.