Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Chart > Multiple Y axis

Not answered Multiple Y axis

Feed from this thread
  • Jacek Kowalski avatar

    Posted on Jul 16, 2008 (permalink)

    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?

    Reply

  • Dwight Dwight admin's avatar

    Posted on Jul 17, 2008 (permalink)

    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:
    1 public partial class Form1 : Form 
    2
    3     private int[][] data = new int[][] { 
    4         new int[] { 10, 3, 12, 3, 7, 6, 4, 9 },  
    5         new int[] { 1000, 3000, 2000, 14000, 12000, 21000, 3500 }, 
    6         new int[] { 12, 3, 44, 7, 8, 9, 10, 11 } 
    7     }; 
    8  
    9     public Form1() 
    10     { 
    11         DataTable table = CreateTableFromData(data); 
    12  
    13         InitializeComponent(); 
    14  
    15         this.radChart1.DataSource = table; 
    16         this.radChart1.DataBind(); 
    17  
    18         this.radChart1.Series[1].YAxisType = ChartYAxisType.Secondary; 
    19     } 
    20  
    21     private static DataTable CreateTableFromData(int[][] data) 
    22     { 
    23         int columnCount = data.Length; 
    24         int recordCount = int.MaxValue; 
    25  
    26         if (columnCount <= 0) return null
    27  
    28         DataTable table = new DataTable(); 
    29  
    30         for (int i = 0; i < columnCount; i++) 
    31         { 
    32             table.Columns.Add(string.Format("data_{0}", i)); 
    33             recordCount = Math.Min(recordCount, data[i].Length); 
    34         } 
    35  
    36         if (recordCount <= 0) return null
    37  
    38  
    39         for (int i = 0; i < recordCount; i++) 
    40         { 
    41             DataRow row = table.NewRow(); 
    42  
    43             for ( int j = 0; j < columnCount; j++ ) 
    44                 row[string.Format("data_{0}", j)] = data[j][i]; 
    45  
    46             table.Rows.Add(row); 
    47         } 
    48  
    49         return table; 
    50     } 
    51
    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

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Jacek Kowalski avatar

    Posted on Jul 17, 2008 (permalink)

    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

    Reply

  • Dwight Dwight admin's avatar

    Posted on Jul 18, 2008 (permalink)

    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

    Reply

  • Emma Rennie avatar

    Posted on Dec 23, 2008 (permalink)

    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

    Reply

  • Giuseppe Giuseppe admin's avatar

    Posted on Dec 29, 2008 (permalink)

    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.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Chart > Multiple Y axis