Pre loader

Drawing lines on a graph

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


Hi guys,

I’m not entirely sure I’m approaching this the right way, but we’re having an issue with two different but similar situations. The first is drawing lines on the chart, which create regions on the chart, and the second is to connect two different points together with a line.

In both scenarios we need to draw quite a few lines on the chart surface, the problem is that the line series does not draw lines separate from each other, just one line connected, for example, if i need to draw to parallel lines:

——————— Line 1
——————— Line 2

Like that, the series will connect them and make a Z line instead.

The problem is that if we need to draw 5 lines to connect a 1000 points together, we need to add 500 fast line series to the chart surface and that slows down the performance significantly.

Is there a property somewhere that we missed? Or a series that we can use that does not connect all the lines together ?

Thanks in advance!

  • You must to post comments

Hi Wandisile,

I think you can do this using double.NaN to break line segments.

e.g. if you create a single FastLineRenderableSeries, with XyDataSeries, and append data like this:

// given yValue1, yValue2, yValue3 are three threshold lines
// given xMin, xMax are some defined contants like -100000000 + 10000000
xyDataSeries.Append(xMin, yValue1);
xyDataSeries.Append(xMax, yValue1);
xyDataSeries.Append(xMax, double.NaN);
xyDataSeries.Append(xMin, yValue2);
xyDataSeries.Append(xMax, yValue2);
xyDataSeries.Append(xMax, double.NaN);
xyDataSeries.Append(xMin, yValue3);
xyDataSeries.Append(xMax, yValue3);

The double.Nan breaks the line segment so you should get three horizontal lines.

Want to try it?

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.