Pre loader

PointMarker Label

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

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.

Try SciChart Today

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

Start TrialCase Studies