multiple y-axis

2 posts, 0 answers
  1. david
    david avatar
    218 posts
    Member since:
    May 2007

    Posted 30 Sep 2016 Link to this post

    Hi, I'm trying to reproduce this chart style -

    with a sql datasource that looks like this:

    Period     Person          Sales

    1              Rick                100

    1              Sue                  200

    2              Rick                 120

    2               Sue                 180

    So rick/sue would each have a bar for this respective sales in each period. I cant figure out how to bind the values in the chart?

    Thank you

  2. Vessy
    Vessy avatar
    1641 posts

    Posted 04 Oct 2016 Link to this post

    Hi David,

    I am not quite sure I understand the scenario you are trying to achieve properly. Can you send us a simple scheme of the chart you are targeting, so we can advice you further?

    Is this the result you want to achieve?

    I so, you want to have separate Series item for each person (Rick and Sue in this case), you will have to have separate columns for each person and structure your data base in a similar way (or make a select bringing this result from your DB and bind the chart with this data):
    Period        Rick              Sue
    1                 100               120
    2                  200              180

    You can have a similar configuration:
    <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1">
                <telerik:ColumnSeries Name="Rick" DataFieldY="RickSales">
                <telerik:ColumnSeries Name="Sue" DataFieldY="SueSales">
            <XAxis DataLabelsField="Period">
    Code Behind:
    void Page_Load(object sender, System.EventArgs e)
        RadHtmlChart1.DataSource = GetData();
    private DataSet GetData()
        DataSet ds = new DataSet("Bookstore");
        DataTable dt = new DataTable("Products");
        dt.Columns.Add("Period", Type.GetType("System.Int32"));
        dt.Columns.Add("RickSales", Type.GetType("System.Int32"));
        dt.Columns.Add("SueSales", Type.GetType("System.Int32"));
        dt.Rows.Add(1, 100, 200);
        dt.Rows.Add(2, 120, 180);
        return ds;

    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top