DataTable Binding - series parameter ?

5 posts, 1 answers
  1. Filupa
    Filupa avatar
    10 posts
    Member since:
    Nov 2012

    Posted 14 Nov 2012 Link to this post

    It is possible to define (programmaticaly) all the parameters in a series when I use DataBind

    DataTable tbl = new DataTable();
    ...
    RadHtmlChart1.DataSource = tbl;
    RadHtmlChart1.DataBind();

    for a dynamic page I need to control everyting from the CodeFile (C#)

    thanks in advance

    Jaime


  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 Nov 2012 Link to this post

    Hi,

    You can Programmaticaly define all the parameters in a series when you add RadHtmlChart dynamically in an ASP page. Please take a look into this demo and documentation.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Filupa
    Filupa avatar
    10 posts
    Member since:
    Nov 2012

    Posted 15 Nov 2012 Link to this post

    Princy,

    thanks, but that example doesn't help me, because in the example use:
    scatterChart.PlotArea.Series.Add(...);

    With that option of command I already create some chart.

    But what I need is to know is:
    if I use this option of binding:
    RadHtmlChart1.DataSource = tbl;
    RadHtmlChart1.DataBind();

    how can I setup all the series parameter programmaticaly (for all the series in the DataSource)?

    This is because I never define the series (like the example):
    ScatterLineSeries theoreticalData = new ScatterLineSeries();
    theoreticalData.Name = "Theoretical Data";


    Jaime
  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Nov 2012 Link to this post

    Hi,

    You can setup the series parameter programmaticaly as follows.

    C#:
    RadHtmlChart1.DataSource = GetData();
    RadHtmlChart1.DataBind();
    ScatterLineSeries series1 = new ScatterLineSeries();
    series1.Name = "0.8C";
    series1.DataFieldX = "ChargeTime08C";
    series1.DataFieldY = "ChargeCurrent08C";
    RadHtmlChart1.PlotArea.Series.Add(series1);

    Thanks,
    Princy.
  6. Filupa
    Filupa avatar
    10 posts
    Member since:
    Nov 2012

    Posted 16 Nov 2012 Link to this post

    Excelent, Thanks
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017