SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

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.