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

Chart Orientation

4 Answers 68 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Marcello
Top achievements
Rank 1
Marcello asked on 20 Jan 2015, 11:09 AM
Hi,

in Wpf demos, the Galleries -> Bar example allow to switch chart orientation  between Horizontal and Vertical.
It work binding:

demo:OrientationBehavior.Orientation="{Binding ChartOrientation, Mode=TwoWay}"

Exists documentation about this?
How to add a check for a generic cartesian chart as Vertical/Horizontal switch?

Thank's very much,
marc.

4 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 23 Jan 2015, 07:49 AM
Hi Marcello,

The orientation change functionality provided through the OrientationBehavior class is created with custom code which means that it is not built-in in the chart. You can find the implementation of the OrientationBehavior class in the demo solution where the Chart Orientation demo is placed. The demo is located under the Product Versions page for UI for WPF in your account. To navigate to there you can open our website click on the "Products & Subscriptions" button and choose the corresponding product that contains the UI for WPF suite. Then click on the blue "Download" button to open the Donwload List page. Find the "UI for WPF" section and click its "Browse all product files" button. This will open the Product Versions page where you can find the "Demo.zip" file which contains the demos solution.

You can use this approach to implement a check logic for changing the orientation. In addition I also attached a sample project demonstrating such customization. Please take a look at it and let me know if it works for you.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Marcello
Top achievements
Rank 1
answered on 26 Jan 2015, 04:20 PM
Hello,

so it's just an axes exchange!
I want to compliment you. The architecture of your charts is unmatched making everything perfectly linear and simple.
0
Marcello
Top achievements
Rank 1
answered on 30 Jan 2015, 05:25 PM
Hi Martin,

A problem occours if PanAndZoomBehavior is enabled.
I change the ZoomMode property and the zoom in effect works good.
But the zoom scrollbar appears allways horizontally!

Solutions?
Thank's.
0
Martin Ivanov
Telerik team
answered on 03 Feb 2015, 04:08 PM
Hello Marcello,

It seems that there is an issue in the RadCartesianChart control that concerns the PanZoomBars used for zooming and scrolling on the axes. I logged it in our feedback portal where you can track its status. I also updated your Telerik points as a small sign of gratitude for helping us finding the issue. As a workaround you can 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);
    }));
}

Please let me know if this works for you.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ChartView
Asked by
Marcello
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Marcello
Top achievements
Rank 1
Share this question
or