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

Create a chart with multiple lines entirely through code

1 Answer 52 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ramya
Top achievements
Rank 1
Ramya asked on 08 Oct 2012, 02:15 PM
Hi,
I wanted to create a chart with multiple lines as shown in the attached image entirely in code as i want to create it dynamically. How do i do it. Would appreciate a working sample.

Thanks,
Ramya

1 Answer, 1 is accepted

Sort by
0
Accepted
Petar Marchev
Telerik team
answered on 11 Oct 2012, 07:40 AM
Hello Ramya,

Do you have any specific question on how to do this? In general the RadCartesianChart can be defined either through XAML or C# (or both). So, yes, you can set up your chart in C# completely. I have attached a very simple app to demonstrate this. The C# code in the ctor is the equivalent of the commented XAML.

Note that I have used both PropertyNameDataPointBinding and GenericDataPointBinding. This is only to demonstrate the alternatives. The XAML parser creates PropertyNameDataPointBinding, but I think in code behind it is much more convenient to use the GenericDataPointBinding.

Greetings,
Petar Marchev
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Ramya
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or