Pre loader

Tag: DrawInternal

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 vote
19k views

Hello again!
I’m using new SciChart 3.2 Beta version. In the 3.1 version I had this code snippet to draw (only one) point marker:

protected override void DrawInternal(IRenderContext2D context, IEnumerable<Point> centers, IPen2D pen, IBrush2D brush)
        {
            var viewportRect = new Rect(new Point(0, 0), context.ViewportSize);

            float width = (float)Width;
            float height = (float)Height;
            Point lastPoint = new Point();
            var custBrush = context.CreateBrush(new SolidColorBrush(Colors.White));
            foreach (var center in centers)
            {
                if (IsInBounds(center, width, height, viewportRect))
                {
                    lastPoint=new Point(center.X,center.Y);
                }
            }
            context.FillRectangle(custBrush, new Point(lastPoint.X - 100, lastPoint.Y), new Point(lastPoint.X - 100 + NameToDisplay.Length * 4 * (FontSize / 8.0), lastPoint.Y + 20 * (FontSize / 8.0)), 0);
            context.DrawText(new Rect(lastPoint.X - 100, lastPoint.Y, NameToDisplay.Length * 4 * (FontSize / 8.0), 20 * (FontSize / 8.0)), FontColor, FontSize, NameToDisplay);
            custBrush.Dispose();
        }

But in new version all point markers are drawn only with this method :

protected override void DrawInternal(IRenderContext2D context, double x, double y, IPen2D pen, IBrush2D brush)
{....

How can I switch it to draw only by the method with centers (not with single point) , because I need to show only last visible point of renderable series ?
Thanks in advance!

  • Egor asked 9 years ago
  • last active 9 years ago
Showing 1 result

Try SciChart Today

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

Start TrialCase Studies