When there is defined a ChartPanAndZoomBehavior and the axes of the chart are switched at run-time, the orientation of the PanZoomBar elements it is not changed.
Workaround:
Get the PanZoomBar element and set its Orientation property.
private void TrySetOrientation(CartesianAxis axis, Orientation orientation)
{
var panZoomBar = Telerik.Windows.Controls.ChildrenOfTypeExtensions.FindChildByType<PanZoomBar>(axis);
if (panZoomBar != null)
{
panZoomBar.Orientation = orientation;
}
}
private void SwapAxes()
{
// Swapping code here
this.Dispatcher.BeginInvoke((Action)(() =>
{
this.TrySetOrientation(this.chart.HorizontalAxis, Orientation.Horizontal);
this.TrySetOrientation(this.chart.VerticalAxis, Orientation.Vertical);
}));
}