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

How to add two line series to a single secondary Y-axis in RadCartesianChart

2 Answers 190 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dinesh
Top achievements
Rank 1
Dinesh asked on 21 May 2013, 08:32 AM
Hi All,
We are developing an Windows Store app,which we need to show data in charts can we bind two bar series to left-side y axis and two line series to right-side secondary y axis is it possible by code or at design.Any one can provide any solution or code is much appreciated.

Thanks
D Haraveer

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosy Topchiyska
Telerik team
answered on 22 May 2013, 12:15 PM
Hello,

Here is the solution I suggest.

You have to create a class that inherits the Collection<Axis> class in your project.

public class CustomAxes : Collection<Axis> { }

This will make it possible to define custom collection of axes that will be used by the corresponding series. Next you have to create CustomAxes object in the resources of your application and fill it with the axes you want to have in your chart:  

<local:CustomAxes x:Key="customAxes">
    <telerik:LinearAxis HorizontalLocation="Left"/>
    <telerik:LinearAxis HorizontalLocation="Right"/>
</local:CustomAxes>

Now you have to bind the vertical axes of your series to the custom axes:

<telerik:BarSeries VerticalAxis="{Binding Source={StaticResource customAxes}, Path=[0]}">

I have also attached an example project.

I hope this was helpful and let me know if you have any further questions.

Greetings,
Rositsa Topchiyska
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Dinesh
Top achievements
Rank 1
answered on 23 May 2013, 07:32 AM
Hi Rositsa Topchiyska,

Thanks a lot for your support,it worked fine

Thanks
D Haraveer
Tags
Chart for XAML
Asked by
Dinesh
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Dinesh
Top achievements
Rank 1
Share this question
or