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

Kendo Bar/Column Chart Series Name Remote Data

4 Answers 241 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 22 Sep 2014, 05:22 PM
I'm trying to get a chart to bind the series from a WebAPI call.  The data is coming back in the following json format.  Each object in the return should create one bar/column on the chart with the "Name" being the corresponding label/categoryAxis value.

Thoughts?

[{"Name":"Site1","Count":4,"Color":"#02bc84"},{"Name":"Site2","Count":3,"Color":"#f08080"}]

4 Answers, 1 is accepted

Sort by
0
Holger
Top achievements
Rank 1
answered on 23 Sep 2014, 06:16 AM
Hello Rob,

Please try this one: http://dojo.telerik.com/@Holger/EQuB

Regards,
Holger
0
Rob
Top achievements
Rank 1
answered on 23 Sep 2014, 01:42 PM
Thanks Holger!  That is what I'm looking for!  Is it possible to do this using the Fluent or MVC HTMLHelper as well?
0
Holger
Top achievements
Rank 1
answered on 24 Sep 2014, 06:34 AM
Hello Rob,

I'm pretty sure it will be possible, but since I'm not using the ASP.NET MVC version of Kendo UI I cannot help you in this regard.

Regards,
Holger
0
T. Tsonev
Telerik team
answered on 24 Sep 2014, 09:04 AM
Hi,

The MVC version of the sample provided by Holger will look similar to this:
@(Html.Kendo().Chart<MyModel>()
    .DataSource(ds => ds.Read(read => read.Action("Read", "Data")))
    .Series(series => { series
        .Column(
            model => model.Count,
            colorExpression: model => model.Color)
        .Name("Count");
    })
    .CategoryAxis(axis => axis
        .Categories(model => model.Name)
    )
)


You can check out the remote data binding demo as well.

I hope this helps.

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
Rob
Top achievements
Rank 1
Answers by
Holger
Top achievements
Rank 1
Rob
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or