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

Multiple Y axis

5 Answers 208 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jacek Kowalski
Top achievements
Rank 1
Jacek Kowalski asked on 16 Jul 2008, 05:18 PM
Hello

    How to create multiple Y axis?
    Each Y axis has to be under previous Y axis.

    There was a post which inform that it is possible 
    http://www.telerik.com/community/forums/thread/b311D-baehkm.aspx
    but I can not create any example with multiple Y axis.
    Can you send me some easy example with source code?

5 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 17 Jul 2008, 07:34 AM
Hello Jacek,

Our RadChart supports up to two Y axes:
radChart1.PlotArea.YAxis and radChart1.PlotArea.YAxis2.

Here is a short example that demonstrates the use of the second YAxis:
public partial class Form1 : Form 
    private int[][] data = new int[][] { 
        new int[] { 10, 3, 12, 3, 7, 6, 4, 9 },  
        new int[] { 1000, 3000, 2000, 14000, 12000, 21000, 3500 }, 
        new int[] { 12, 3, 44, 7, 8, 9, 10, 11 } 
    }; 
 
    public Form1() 
    { 
        DataTable table = CreateTableFromData(data); 
 
        InitializeComponent(); 
 
        this.radChart1.DataSource = table; 
        this.radChart1.DataBind(); 
 
        this.radChart1.Series[1].YAxisType = ChartYAxisType.Secondary; 
    } 
 
    private static DataTable CreateTableFromData(int[][] data) 
    { 
        int columnCount = data.Length; 
        int recordCount = int.MaxValue; 
 
        if (columnCount <= 0) return null
 
        DataTable table = new DataTable(); 
 
        for (int i = 0; i < columnCount; i++) 
        { 
            table.Columns.Add(string.Format("data_{0}", i)); 
            recordCount = Math.Min(recordCount, data[i].Length); 
        } 
 
        if (recordCount <= 0) return null
 
 
        for (int i = 0; i < recordCount; i++) 
        { 
            DataRow row = table.NewRow(); 
 
            for ( int j = 0; j < columnCount; j++ ) 
                row[string.Format("data_{0}", j)] = data[j][i]; 
 
            table.Rows.Add(row); 
        } 
 
        return table; 
    } 
The CreateTableFromData method is of no importance to the example, it just creates DataTable out of an array (copying the data into rows).

Look at line 18, where I set Series[1] to use the secondary YAxis.

Let me know if that example helps or you need different functionality.

Regards,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jacek Kowalski
Top achievements
Rank 1
answered on 17 Jul 2008, 03:21 PM
your example works, but it is not enough good to me because I need more then 2 Y axis (each axis has to be below the previous Y axis)

Regards
Jacek
0
Dwight
Telerik team
answered on 18 Jul 2008, 07:13 AM
Hi Jacek,

Can you, please, elaborate more on the functionality you require? The RadChart control also supports scalebreaks, that can be used to split the YAxis to multiple ranges. Analyzing your requirements could help us provide a solution and/or add a new feature request in our system.

Kind regards,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Emma Rennie
Top achievements
Rank 1
answered on 24 Dec 2008, 01:37 AM
Hi,

I am also interested in this feature.  I have been looing into the chart control and really need it to produce more then 2 series axis.  See the link which i did with infragistics

thanks
zdravko
0
Giuseppe
Telerik team
answered on 29 Dec 2008, 09:24 AM
Hello Zdravko,

Thank you for contacting us.

Unfortunately as stated before the control does not support the desired functionality (more than 2 YAxes). We will forward your feedback to our developers but at the moment we are focused on developing a WPF / Silverlight charting control and it is unlikely that this feature will be added to the ASP.NET control.


Best wishes,
Manuel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (obsolete as of Q1 2013)
Asked by
Jacek Kowalski
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Jacek Kowalski
Top achievements
Rank 1
Emma Rennie
Top achievements
Rank 1
Giuseppe
Telerik team
Share this question
or