Pre loader

Graphs Auto-Scale when they shouldn't under specific conditions

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


When I yAxis.setVisibleRange(0.d,10.d) then add a series, it triggers AutoRange to resize the graph.

If the VisibleRange is ANYTHING other than 0,10 (even 0,10.001) then it doesn’t resize the graph.

during my search, I found that setting Axis.AutoRange to .NEVER will stop the issue from happening.

I still wanted to post this here because this is a notable bug that others will come across, and I wanted to show what solution I found.

  • You must to post comments

Hi Peter,

I’m not sure that it’s a bug. This is part of default behavior which prevents setting of same range for axis and skips any updates in this case. By default axis is created with value provided by getDefaultNonZeroRange() ( for NumericAxis this is (0, 10) range ) and if you try to set the same range for axis nothing will happen. As result in this case AutoRange.Once mode which is used by default will be triggered as you start the chart.

To workaround this limitation you can try to create custom axis and pass alternative default non zero value via constructor:

class CustomNumericAxis extends NumericAxis {
    public CustomNumericAxis(Context context) {
        super(new DoubleRange(-100d, 100d), new AxisModifierSurface(context));

Also you can create custom ViewportManager for chart and choose on your own when to perform auto range on axis:

class CustomViewportManager extends DefaultViewportManager {
    protected void onApplyAutoRange(IAxis axis) {
        // super.onApplyAutoRange(axis);
        // set MaximumVisibleRange or some other range on axis
        // if auto range is requried and axis satisfies desired conditions

Hope this will help you!

Best regards,

  • 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