Pre loader

DrawText in InternalDraw

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
0

Hello, everybody

I am working with drawing text in InternalDraw of FastLineRenderableSeries method.
I have got two questions:

1) When I am changing FontSize dynamically, I get this picture (img 1). How can I fix this problem? P.S. this problem starts to appear when I display two or more renderable series.

2) Is there any method or simple way to get all visible points from FastLineRenderableSeries?
Thanks in advance

Images
  • You must to post comments
1
0

Hi Vyacheslav,

The RenderContext.DrawText method is not super well defined. It requires a bounding rect which constains (and scales) the text. We use it internally to draw text within cells or columns and scale or hide text that is smaller than the bounding rect. So, if you want a larger font, you have to also change the bounding rect.

I can ask the team if we can add an overload to DrawText with FontSize and not be bounded by the rectangle

Regarding all visiblepoints from RenderableSeries, you can do this:

var visibleRange = renderSeries.XAxis.VisibleRange;
// then simple
int lowIndex = renderSeries.DataSeries.FindIndex(visibleRange.Min, SearchMode.Nearest);
int highIndex = renderSeries.DataSeries.FindIndex(visibleRange.Max, SearchMode.Nearest);

This will return the indices to the data in the viewport (it will make the assumption that data is sorted in X direction).

Best regards,
Andrew

  • 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