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

Maunally assign Data to Chart

3 Answers 68 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
buda56
Top achievements
Rank 1
buda56 asked on 31 Jul 2008, 05:02 AM
Hi,
    I seem to be a little lost with this, I have returned a collection of data from a data base and wish to manually bind this to the RADChart.
The data I collect binds okay to the chart but only shows 8 values when the collection returns 16, also the date does not show across the bottom.

The data row consists of 3 values and a date per row
i.e 20/07/2008, 354, 45, 32

I would like to have the data values show as line date and the coresponding date across the bottom of the chart. I have included my data collection and assignment code below.

DateTime eDate = DateTime.Today;

DateTime sDate = Convert.ToDateTime("01/" + eDate.AddMonths(-1).Month + "/" + eDate.AddMonths(-1).Year);

JobsOpenCollection JColl = new JobsOpenCollection();

JColl.Query.Select

(JColl.Query.CaOpen, JColl.Query.ChOpen, JColl.Query.TskOpen, JColl.Query.Date)

.Where(JColl.Query.Date.Between(sDate, eDate));

JColl.Query.Load();

JColl.Sort =

"Date";

rchWork.DataSource = JColl;

rchWork.DataBind();


Can you please advise..

Regards..
Peter

3 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 31 Jul 2008, 07:36 AM
Hello buda56,

We would suggest you to review this online example here that demonstrates how you can display DateTime data on the numerical axes of RadChart -- the key is to use the DateTime.ToOADate() method in order to convert the DateTime data to double values as the numerical axes work only with numeric types.

We have attached a sample application as well.


Sincerely yours,
Manuel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
buda56
Top achievements
Rank 1
answered on 01 Aug 2008, 05:36 AM
Manuel,
           Thanks for the example code, I have reviewed and set my project up similar and this has highlighted several issues.

1. The chart is only showing 8 columns of values when there are currently 16 (eventually there will be 30 values to display for each series).
2. The date values added don't line up with the data in the chart.
3. The date values are to close together (I need to be able to show only every 3rd or 4th date value)
4. There is a space from the vertical axis to the series start points (see below).



Regards..
Peter 
0
Giuseppe
Telerik team
answered on 01 Aug 2008, 07:03 AM
Hello buda56,

We are unable to open the view your chart snapshot as you have probably provided a link to the ChartHttpHandler generated image but its cache has already expired thus the image is not available now. As for your issues -- could you confirm whether you observe any of them in the attached sample site or the online example?

It would be best if you open a formal support ticket and send us a runnable sample application that we can investigate locally.


Regards,
Manuel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
buda56
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
buda56
Top achievements
Rank 1
Share this question
or