SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

0
0

What is the best way to add a label to the point marker? I was able to achieve this by creating a custom point marker and overriding the Draw method, but sometimes the spacing between the point marker and the text is a little off.

Here is what I did:

public override void Draw( IRenderContext2D context, IEnumerable<System.Windows.Point> centers )

looping through the centers and adding text

var size = _measuringGraphics.MeasureString( “my label”, new System.Drawing.Font( Core.Constants.UIConstant.GridFontFamily, 9 ) );
context.DrawText( new System.Windows.Rect( center, new System.Windows.Size( size.Width, size.Height ) ), Colors.Black, fontSize, “my label”);

Thanks,
Doug

Version
nuget package SciChart.4.2.3.10193
  • You must to post comments
0
0

Hello Doug,

Please take a look at this example and CustomPointMarker, you can see a full example of this API here:

CustomPointMarker with metadata

Also please let us know if it solves your problem.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

SciChart WPF v5 is here! Use the discount code SCICHARTV5 to get 15% off WPF Charts until December 31st!Read More
+