Pre loader

Tag: double.NaN

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
13k views

Hi,

When rendering a FastLineRenderableSeries, there are line segments missing both before and after a double.NaN Y value. This makes sense for a regular line series, but for a step line series (where IsDigitalLine=True), why isn’t the line segment preceding the NaN being drawn? When plotting (for example) financial prices over time, the missing line before the NaN gives the impression that a price didn’t exist for that period, which is incorrect.

I’m looking at the IterateLines method in FastLinesHelper. Even though the method has an isDigitalLine parameter, it isn’t checked during the handling of a NaN value. Is this an oversight?

Thanks very much,

Graham.

3 votes
0 answers
7k views

Hi there!
I successfully build trader chart from nice example “2D Charts -> Create Stock Charts -> Using SciStockChart”.
Then I had to draw line on the chart with candles, but the problem was, that the line didn’t have data on some dates (there is data for lots of candles, but for the red line there is only 4 points: A,B,C,D), and result i want in shown here (solved):
Result i want image

Axes:
XAxis: CategoryDateTimeAxis (Dates)
YAxis: NumericAxis (Prices)

Series:
Candles: FastCandlestickRenderableSeries (OhlcDataSeries<DateTime, double>)
Red Line: FastLineRenderableSeries (XyDataSeries<DateTime, double>)

Problem:
CategoryDateTimeAxis type ignores the XAxis values for computation of x-coordinate, and choosing only the index of the value instead. CategoryDateTimeAxis vs DateTimeAxis. I have N-number of candles and only 4 values for red line. How to receive line with no gaps, with points on their places (dates on X-axis) ? I can’t use simple DateTimeAxis, because candles don’t draws.

Solution:
1) Use double.NaN for each date (x-axis value) if no data for the red-line on date given.
2) In FastLineRenderableSeries set DrawNaNAs = LineDrawMode.ClosedLines (if don’t use this flag, you will receive something like this: WPF Chart Gaps (Nulls) in Series

Thanks a million to Julia Skorobogata from SciChart!

Showing 2 results

Try SciChart Today

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

Start TrialCase Studies