Hi,
I'm using old radchart and can't change (r.a.d.controlsQ3 2006 --> dll 2.9.2.0).
I need to create a chart where i would have every day of a month on the xAxis. Then i would like to place points on the chart for some of thoses days only (based on the data in the database). I will need to create differents chartseries for the same month, that may both have points on the chart but for different days.
I tried creating a chart with all the days of the month as XAxis and add a value to it :
int daysInMonth = DateTime.DaysInMonth(Convert.ToInt32(ddlYear.SelectedValue), month);
int j = 1;
while (j <= daysInMonth)
{
_rcIndexGraph.XAxis.AddItem("" + j + "/" + month);
_rcIndexGraph.XAxis.Items[j - 1].Value = j;
j++;
}
Then add an item to the chart based on the date of my data:
ChartSeries s = _myGraph.GetChartSeries(0);
s.Items.Clear();
foreach (DataRow row in data.Rows)
{
DateTime datetime = Convert.ToDateTime(row["datetime"]);
ChartSeriesItem item = new ChartSeriesItem();
double d = Convert.ToDouble(row["eic_index"]);
d = Convert.ToDouble(d.ToString("N02"));
item.XValue = datetime.Day - 1;
item.YValue = d;
item.PointSize = 6;
s.Items.Add(item);
}
This doesn't work and i also tried to fill the chartseries with "new ChartSeriesItem()" for each day, then fill the one i need later, but adding ChartSeriesItem with no value doesn't work either.
If you have any idea on how i could use the old chart to my purpose, i would be really greatful as this is extremly urgent.
I'm using old radchart and can't change (r.a.d.controlsQ3 2006 --> dll 2.9.2.0).
I need to create a chart where i would have every day of a month on the xAxis. Then i would like to place points on the chart for some of thoses days only (based on the data in the database). I will need to create differents chartseries for the same month, that may both have points on the chart but for different days.
I tried creating a chart with all the days of the month as XAxis and add a value to it :
int daysInMonth = DateTime.DaysInMonth(Convert.ToInt32(ddlYear.SelectedValue), month);
int j = 1;
while (j <= daysInMonth)
{
_rcIndexGraph.XAxis.AddItem("" + j + "/" + month);
_rcIndexGraph.XAxis.Items[j - 1].Value = j;
j++;
}
Then add an item to the chart based on the date of my data:
ChartSeries s = _myGraph.GetChartSeries(0);
s.Items.Clear();
foreach (DataRow row in data.Rows)
{
DateTime datetime = Convert.ToDateTime(row["datetime"]);
ChartSeriesItem item = new ChartSeriesItem();
double d = Convert.ToDouble(row["eic_index"]);
d = Convert.ToDouble(d.ToString("N02"));
item.XValue = datetime.Day - 1;
item.YValue = d;
item.PointSize = 6;
s.Items.Add(item);
}
This doesn't work and i also tried to fill the chartseries with "new ChartSeriesItem()" for each day, then fill the one i need later, but adding ChartSeriesItem with no value doesn't work either.
If you have any idea on how i could use the old chart to my purpose, i would be really greatful as this is extremly urgent.