Pre loader

Have same VisibleRange in multiple charts

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

We use ViewportManager to automatically calculate the visible range of Y-axis for all series in the chart.

   <s:SciChartSurface Margin="0, 5, 0, 0"  Grid.Column="2"
                           ViewportManager="{Binding ViewportManager}"
                           MinHeight="250" MinWidth="250"
                           x:Name="MainChartSurface"
                           RenderableSeries="{s:SeriesBinding SeriesVms}"
                           ChartTitle="{Binding ChartModel.Title}"
                           Loaded="MainChartSurface_Loaded"
                           YAxes="{Binding YAxes}"
                           XAxes="{Binding XAxes}"
                           Style="{StaticResource YAxisStyle}"
                           Annotations="{s:AnnotationsBinding ChartModel.Annotations}">
      :
      : (omitted for brevity)
   </s:SciChartSurface>

This approach works fine for one chart.

We now have an additional requirement, which is to have the same VisibleRange for Y-axis over multiple charts. Basically, the VisibleRange should be set to be the [Min, Max] range over all the series in all charts.

Is there a way to achieve this with ViewportManager ?
Is there a way to make several charts related and assign it a common instance of ViewportManager?

BR, Gianni

Version
5.1.0.11392
  • You must to post comments
0
0

Yes there’s a really easy way to do this. You use WPF’s binding mechanism to bind the YAxis.VisibleRange of several YAxis to a common property in a ViewModel.

Do not share one ViewportManager instance between several charts – that isn’t supported.

In order to bind YAxis.VisibleRange when you are using AxesBinding, you can use the technique of applying styles to Viewmodel Generated types as mentioned in our documentation.

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