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

Dynamic chart

1 Answer 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michal
Top achievements
Rank 1
Michal asked on 29 Oct 2009, 03:55 PM
Hello,

I have another problem. This time I am trying to display "Stacked Line chart" and bind DataTable on NeedDataSource.
DataTable source has 3 columns: DateTime, double, double
I want to show DateTime values on X axis and 2 series on chart. Each for the column. LINK TO CHART

I have tried to find similar example in Documentation but I found only very simple examples.

DataTable looks like that:

10-Jan-2000    1.1    2.0
20-Feb-2000    1.4    2.2
24-Apr-2000    1.3    2.5
...
...
...

Could you please also explain me how the binding work? How to create series, legend etc?

Regards,
Michal.  

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 02 Nov 2009, 04:46 PM
Hi Michal,

The chart item has no intrinsic support for DateTime values. To show DateTime values the chart expects a data source of doubles which are internally converted to DateTime using DateTime.ToOADate() method.

What we would recommend is to change your data source and make the 'Date' column of type double. This column should be populated with values representing the OLE Automation equivalent of your DateTime values.

As for the chart binding, you are correctly pointed to NeedDataSource event - currently the chart can only be bound in this event (more info here).

Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Michal
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or