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

How to send a complex Model to to Kendos chart

1 Answer 66 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Dinesh
Top achievements
Rank 1
Dinesh asked on 23 May 2014, 02:35 PM
Hi,
I am using using kendos Chart control to display four series in graph that shares a common categoryAxis.
I am send data to chart by a Model that contains four properties. These Properties returns me four collection. I want to bind these Properties to my Series of Kendo Chart.
Please suggest if I can achieve this using Model as mentioned above.
Kinf Regards,
Dinesh Mishra

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 27 May 2014, 11:00 AM
Hello,

If I understand correctly, you're binding the series to a model field containing collection of objects.
You can use the following syntax:
    .Series(series =>
    {
        series.Column(Model.FooData).Field("FooValue");
        series.Column(Model.BarData).Field("BarValue");
    })


You'll need to use category binding if the point order is not identical between the series:
        .Series(series =>
        {
            series.Column(Model.FooData).Field("FooValue").CategoryField("Category");
            series.Column(Model.BarData).Field("BarValue").CategoryField("Category");
        })

Each point will be plotted at its respective location on the category axis as specified by "Category".
If two or more points in a series share the same category they'll be aggregated - the maximum will be displayed by default.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
Dinesh
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or