This is a migrated thread and some comments may be shown as answers.

panzoombar for multiple y axis

1 Answer 75 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
jzhou
Top achievements
Rank 1
jzhou asked on 26 Oct 2015, 07:14 AM

Hello,

 I created multiple y axis and line serieses dynamically, but the panzoombar for y axis disappear.

How can I show the panzoombar for each y axis?

Is it possible to hide the panzoombar automatically if there is no zoom, and show the panzoombar if there is zoom.

 thanks

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 28 Oct 2015, 10:23 AM
Hi jzhou jzhou,

RadChartView doesn't support zooming on individual axis. The zooming is shared between all axes. Note that the PanZoomBar will be displayed only if the chart has defined its axes. For example, if you add vertical axes only for the series, but not for the chart itself, the vertical PanZoomBar won't be displayed. We have a feature request for implementing individual axis zooming in our feedback portal where you can track its status. Also, you can take a look at the IndividualAxisZooming SDK example that demonstrates how you can achieve the desired effect using custom code.

As for hiding the PanZoomBar based on the zoom level, you can subscribe for the PanOffsetChanged event of RadCartesianChart and change the PanZoomBar's Visbility in its handler. Here is an example with such customization:
public partial class MainWindow : Window
{
    private PanZoomBar verticalPanZoomBar;
  
    public MainWindow()
    {
        InitializeComponent();
        this.RadCartesianChart.PanOffsetChanged += RadCartesianChart_PanOffsetChanged;
        this.RadCartesianChart.Loaded += RadCartesianChart_Loaded;
    }
  
    void RadCartesianChart_Loaded(object sender, RoutedEventArgs e)
    {
        this.verticalPanZoomBar = this.RadCartesianChart.VerticalAxis.FindChildByType<PanZoomBar>();
    }
  
    void RadCartesianChart_PanOffsetChanged(object sender, ChartPanOffsetChangedEventArgs e)
    {
        if (this.verticalPanZoomBar == null)
        {
            return;
        }
  
        if (this.RadCartesianChart.VerticalZoomRangeStart == 0 &&
            this.RadCartesianChart.VerticalZoomRangeEnd == 1 )
        {
            this.verticalPanZoomBar.Opacity = 0;
        }
        else
        {
            if (this.verticalPanZoomBar.Opacity == 0)
            {
                this.verticalPanZoomBar.Opacity = 1;
            }               
        }
    }
}
I hope this helps.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ChartView
Asked by
jzhou
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or