Multiple Y axis

6 posts, 0 answers
  1. Jacek Kowalski
    Jacek Kowalski  avatar
    2 posts
    Member since:
    Jul 2008

    Posted 16 Jul 2008 Link to this post

    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?
  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 17 Jul 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jacek Kowalski
    Jacek Kowalski  avatar
    2 posts
    Member since:
    Jul 2008

    Posted 17 Jul 2008 Link to this post

    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
  5. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 18 Jul 2008 Link to this post

    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
  6. Emma Rennie
    Emma Rennie avatar
    2 posts
    Member since:
    Apr 2008

    Posted 23 Dec 2008 Link to this post

    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
  7. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 29 Dec 2008 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready