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

Multiple Line Series With Multiple Axes

4 Answers 220 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 03 Mar 2016, 10:48 PM

Hello,

I have several lines (the exact amount will be determined at runtime), each with a different Y axis (but a shared X axis), that I would like to display on the same chart. The X axis should be in date/time format while all of the Y axes should consist of integers. The Y axes should alternate between the left & right sides of the chart. If possible, I'd like all of these to come from a single datasource (a datatable) and be grouped into lines based on a column. I also need the axes to either have labels or colors to distinguish which one goes with which line.

I have no idea how to approach this - I couldn't find much documentation on it and the forum threads that I looked at were quite old. I watched the tutorial here and read the documentation here but I would like to generate all of this at runtime if possible. If what I'm asking is possible, could someone provide me with a sample project or some sample code?

Thank you!

4 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 08 Mar 2016, 11:22 AM
Hello Ryan,

Additional axes can be added as described in the How to: Add Secondary Axis help article. After you create the graph with multiple axes at design-time, you can view the automatically generated code in the Designer.cs file to see how to do the same programmatically. Attached you can find a sample report demonstrating the approach.

Regards,
Nasko
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
0
Ryan
Top achievements
Rank 1
answered on 10 Mar 2016, 07:31 PM

Thanks Nasko! That sample helped a lot. I have a couple more questions:

1. I've managed to create multiple axes & multiple lines, but I need a way to distinguish which axis goes with which line. In the RadChartView I could change the axis color. Is there any way to do something similar with reporting?

2. My data is in a different layout than yours. Could you advise me how to work with this layout:

DateTimeStamp       | Group | Value
3/10/2016 8:00AM    | 1     | 1
3/10/2016 9:00AM    | 1     | 2
3/10/2016 10:00AM   | 1     | 1
3/10/2016 11:00AM   | 1     | 3
3/10/2016 8:00AM    | 2     | 8
3/10/2016 9:00AM    | 2     | 12
3/10/2016 10:00AM   | 2     | 9
3/10/2016 11:00AM   | 2     | 10

Group would be the line that should be represented on the chart.

Thanks again!

0
Accepted
Nasko
Telerik team
answered on 15 Mar 2016, 11:54 AM
Hello Ryan,

The axes' colors can be changed via the Style property of the axis. More information is available in the Formatting a Graph help articles.

Your data can be used to feed the graph as demonstrated in the attached sample report. 

Regards,
Nasko
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
0
Ryan
Top achievements
Rank 1
answered on 23 Mar 2016, 02:12 PM
Worked perfectly - thank you, Nasko!
Tags
General Discussions
Asked by
Ryan
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or