This is a migrated thread and some comments may be shown as answers.

DataTable Binding - series parameter ?

4 Answers 135 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Filupa
Top achievements
Rank 1
Filupa asked on 14 Nov 2012, 08:10 PM
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


4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Nov 2012, 04:54 AM
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.
0
Filupa
Top achievements
Rank 1
answered on 15 Nov 2012, 01:06 PM
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
0
Accepted
Princy
Top achievements
Rank 2
answered on 16 Nov 2012, 04:29 AM
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.
0
Filupa
Top achievements
Rank 1
answered on 16 Nov 2012, 12:37 PM
Excelent, Thanks
Tags
Chart (HTML5)
Asked by
Filupa
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Filupa
Top achievements
Rank 1
Share this question
or