Hi,
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?
Thanks
Xaxis - works
public void XAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
{
if (e.IsScrolling)
return;
e.VisibleMinimum = (double)e.ActualMaximum - 100d;
}
Yaxis - Candles do not render
private void YAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
{
if (e.IsScrolling)
return;
e.VisibleMinimum = Convert.ToDouble(e.ActualMaximum) + 10;
}
XAML code
<charts:SfChart
x:Name="financialChart">
<charts:SfChart.DataContext>
<local:CandleChartViewModel/>
</charts:SfChart.DataContext>
<charts:SfChart.Behaviors>
<charts:ChartCrossHairBehavior/>
</charts:SfChart.Behaviors>
<charts:SfChart.PrimaryAxis>
<charts:DateTimeCategoryAxis ShowTrackBallInfo="True" LabelFormat="HH:mm" Interval="20" IntervalType="Minutes" EnableScrollBar="True" ActualRangeChanged="XAxis_ActualRangeChanged" Margin="4"/>
</charts:SfChart.PrimaryAxis>
<charts:SfChart.SecondaryAxis>
<charts:NumericalAxis ShowTrackBallInfo="True" OpposedPosition="True" Margin="-2" ActualRangeChanged="YAxis_ActualRangeChanged" />
</charts:SfChart.SecondaryAxis>
<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"
>
</charts:CandleSeries>
</charts:SfChart>