How to bind array values to make 2 lineseries line chart please ?

3 posts, 1 answers
  1. Pierre
    Pierre avatar
    4 posts
    Member since:
    Apr 2016

    Posted 20 Jun Link to this post

    I want to bind on one array to draw a 2 lines chart like
                decimal[] pumpA_array = { 18.6m, 26.5m, 25.8m, 24.3m, 24.9m, 23.2m, 22.0m, 22.4m, 22.9m, 21.7m, 21.2m, 20.2m };
                decimal[] pumpB_array = { 5m, 10m, 15m, 20m, 25m, 30m, 35m, 30m, 25m, 24m, 22m, 20m };



    How must i bind to my array's to get 2 lines like Attached image file please ?

    In the telerik example datasource get only one array OR it is declaratively...


    THANKS for your help



  2. Answer
    Stanimir avatar
    1653 posts

    Posted 20 Jun Link to this post

    Hello Pierre,

    You can only data bind a Chart instance with a single data source. In your cease you need to transform your two arrays in a single IEnumerable data source or DataSet (review the following example then data bind the chart with it.

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pierre
    Pierre avatar
    4 posts
    Member since:
    Apr 2016

    Posted 20 Jun Link to this post

    Hello Stanimir,

    As you say, it's OK !


    Great THANKS


    PS: My working example:

                DataSet ds = new DataSet("PumpPressure");
                DataTable dt = new DataTable("PumpA");
                dt.Columns.Add("ID", Type.GetType("System.Int32"));
                dt.Columns.Add("ValuePumpA", Type.GetType("System.Decimal"));
                dt.Columns.Add("ValuePumpB", Type.GetType("System.Decimal"));
                dt.Columns.Add("ValuePumpC", Type.GetType("System.Decimal"));
                dt.Columns.Add("ValuePumpD", Type.GetType("System.Decimal"));
                for (int i = 0; i < 12; i++)


                RadHtmlChart1.DataSource = GetData();



Back to Top