We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dynamically Resize Y Axis


Currently I dynamically resize the X axis using code from the ChartAutoScrollingDemo_2013 as below.  I've tried to adpat this to the Y axis but when doing so the candles are no longer plotted although I can the chart is functioning as the X asix continues to scroll.

Is this possible to do?


Xaxis - works

       public void XAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
            if (e.IsScrolling)
            e.VisibleMinimum = (double)e.ActualMaximum - 100d;

Yaxis - Candles do not render

        private void YAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
            if (e.IsScrolling)
            e.VisibleMinimum = Convert.ToDouble(e.ActualMaximum) + 10;

XAML code



                <charts:DateTimeCategoryAxis ShowTrackBallInfo="True" LabelFormat="HH:mm" Interval="20" IntervalType="Minutes" EnableScrollBar="True" ActualRangeChanged="XAxis_ActualRangeChanged" Margin="4"/>
                <charts:NumericalAxis  ShowTrackBallInfo="True" OpposedPosition="True" Margin="-2" ActualRangeChanged="YAxis_ActualRangeChanged" />

            <charts:CandleSeries Name="series" ItemsSource="{Binding obPriceBar}" StrokeThickness="1" XBindingPath="DateTime"  High="High" Open="Open" Close="Close"
                                 Low="Low"  Label="Candleseries" ShowTooltip="True" BearFillColor="Blue" BullFillColor="Red"
                                 charts:ChartTooltip.HorizontalAlignment="Left" charts:ChartTooltip.TooltipMargin="10"

2 Replies

SS Suresh S Syncfusion Team May 18, 2015 12:30 PM UTC

Hi Tim,

We were able to reproduce the issue and we have confirmed this as bug and logged a report on this. Also we have created a support incident under your account to track the status of this issue.

Please log on to our support website to check for further updates.

Link: https://www.syncfusion.com/account/login


Suresh S

SK Satheesh Kumar T Syncfusion Team May 20, 2015 09:15 AM UTC

Hi Tim,
Please ignore the previous update.
Upon further analysis with your problem in source, we have confirmed this as a behavior. Please find the details below.

Event Arguments

Use Case


Get or set the start value of the axis.


Get or set end value of the axis.

VisibleMinimum & VisibleMaximum

To define the range of values to be display for the view port.

Note: VisibleMinimum and VisibleMaximum should be lay between the ActualMinimum and ActualMaximum.
In your code snippet, we have noticed the below code.
e.VisibleMinimum = Convert.ToDouble(e.ActualMaximum) + 10d;
It will results to VisibleMinimum is greater than ActualMaximum, then it will not work.

If your requirement is to show only the last few range of values in Y Axis as like AutoScrolling Demo, we can set VisibleMinimum as below:
e.VisibleMinimum = (double)e.ActualMaximum - 100d; //to view last 100 range values in view port.
e.VisibleMinimum = Convert.ToDouble(e.ActualMinimum) + 10d; //to ignore the 10 initial values.
Note: If this is not your requirement, please provide more information regarding your requirement so that we can provide you the better solution.
Please let us know, if you need any further assistance.
Satheesh Kumar T

Live Chat Icon For mobile
Up arrow icon