Dears,
I am using HtmlChart and encounter some problems.
(1).I try to create series from the data table by creating SeriesItem which needs X and Y values. I saw the item must be decimal but actually my data is X:datetime, and Y:Decimal type. How to create the X value by datetime or even the string value?
ScatterLineSeries series1 = new ScatterLineSeries();
series1.Name = "date_time";
series1.LabelsAppearance.Visible = false;
foreach (DataRow row in MyDataTable.Rows)
{
string xx = "traffic_erlang";
SeriesItem item1 = new SeriesItem( 100,(decimal)row[xx]); //I put the static value 100 as I don't know how to put the datetime/string
series1.Items.Add(item1);
RadHtmlChart1.PlotArea.Series.Add(series1);
RadHtmlChart1.PlotArea.Series.Add(series2);
}
(2).Do we have any other ways to bind data from datatable by grouping the fields so the dynamic series will be created.
example:
--------------------------
ID | Name | Value
--------------------------
1 | ABC | 200
2 | GED | 340
...... which Name is the dynamic data
I am using HtmlChart and encounter some problems.
(1).I try to create series from the data table by creating SeriesItem which needs X and Y values. I saw the item must be decimal but actually my data is X:datetime, and Y:Decimal type. How to create the X value by datetime or even the string value?
ScatterLineSeries series1 = new ScatterLineSeries();
series1.Name = "date_time";
series1.LabelsAppearance.Visible = false;
foreach (DataRow row in MyDataTable.Rows)
{
string xx = "traffic_erlang";
SeriesItem item1 = new SeriesItem( 100,(decimal)row[xx]); //I put the static value 100 as I don't know how to put the datetime/string
series1.Items.Add(item1);
RadHtmlChart1.PlotArea.Series.Add(series1);
RadHtmlChart1.PlotArea.Series.Add(series2);
}
(2).Do we have any other ways to bind data from datatable by grouping the fields so the dynamic series will be created.
example:
--------------------------
ID | Name | Value
--------------------------
1 | ABC | 200
2 | GED | 340
...... which Name is the dynamic data