Pre loader

When set ZeroLineY of FastRenderseries, ImpulseSeries, StackedSeries,.. = double.MinValue, the MaximumRange of YAxis always returns 0-10.

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

Hi everyone,

When I add the data in FastRenderSeries as the code below:

var dataSeries = new XyDataSeries<double, double> { SeriesName = "Histogram" };
        var yValues = new List<KeyValuePair<double, double>>
        {
            new KeyValuePair<double,double>(1.0,1.0),
            new KeyValuePair<double,double>(2,1),
            new KeyValuePair<double,double>(3,1),
            new KeyValuePair<double,double>(4,1),
            new KeyValuePair<double,double>(4,1),
            new KeyValuePair<double,double>(9,1),
            new KeyValuePair<double,double>(10,1),
        };

using (this.sciChart.SuspendUpdates())
        {
            foreach (var yValue in yValues)
            {
                dataSeries.Append(yValue.Key, yValue.Value);
            }
            this.columnSeries.DataSeries = dataSeries;
        }

And I try to get range of this series by this code:
var range = sciChart.YAxis.GetMaximumRange();

I got the range is from 0 ->1.1 (as my expectation). However, when I set ZeroLineY = double.Min of series and get the range of YAxis again, I got the range is from 0 -> 10 (not my expectation).

Does anybody now why it has the different result with and without setting ZeroLineY?

  • You must to post comments
0
0

I know why this happens.

SciChart looks at your data, which now includes Double.MinValue and believes this is an invalid range. It falls back to the last known valid range, which is 0…10.

An alternative idea is to bind ZeroLineY OneWay to YAxis.VisibleRange.Min. That way whenever you zoom and pan the mountain always draws to the bottom of the viewport.

If that doesn’t work, another idea is to set ZeroLineY to -1E100 or some other absurdly large negative value. It should work and without the issue you see.

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