can't get the point where i want them

Thread is closed for posting
3 posts, 0 answers
  1. maternag
    maternag avatar
    15 posts
    Member since:
    Oct 2006

    Posted 24 Jun 2008 Link to this post

    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. maternag
    maternag avatar
    15 posts
    Member since:
    Oct 2006

    Posted 24 Jun 2008 Link to this post

    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).
  3. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 25 Jun 2008 Link to this post

    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
Back to Top