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

[Solved] can't get the point where i want them

2 Answers 77 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
maternag
Top achievements
Rank 1
maternag asked on 24 Jun 2008, 08:34 AM
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.

2 Answers, 1 is accepted

Sort by
0
maternag
Top achievements
Rank 1
answered on 24 Jun 2008, 12:54 PM
Unfortunatly its seems to be a bug in the object. I was using autoScale = false and i got this bug where all the point where placed on the XAxis at with x = 0 no matter what. Once i used autoScale = true, all the points are positioned at the right place. Except now the YAxis is bugged and is not on the left anymore, but on the right (but th YAxis scale value are still on the left however, which is very weird).
0
Giuseppe
Telerik team
answered on 25 Jun 2008, 08:51 AM
Hello maternag,

RadChart 2.x does not support Strict mode for the XAxis values i.e. the XValues you specify for the chart items are not respected and the control simply renders the items one after another with regular spacing. You will need to upgrade to the latest version of the control if you would like to utilize such functionality.


Kind regards,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Chart (Obsolete)
Asked by
maternag
Top achievements
Rank 1
Answers by
maternag
Top achievements
Rank 1
Giuseppe
Telerik team
Share this question
or