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

Databinding htmlchart vs radchart

1 Answer 59 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Tonie Venter
Top achievements
Rank 1
Tonie Venter asked on 19 Feb 2014, 08:18 AM
I am trying to migrate from radchart to the new htmlchart, however there seems to be a major difference in  how the databinding works in the htmlchart. With Radchart I am currently building a graph using a datasource like this:
Vendor    Subcategory   Value
xxx          Sub1               100
yyy          Sub1                200
zzz          Sub1                150
xxx          Sub2               100
yyy          Sub2                200
zzz          Sub2                150

I use this code to bind to the datasource

this.RadChartEvalSubcategory.Clear();
this.RadChartEvalSubcategory.DataGroupColumn = "Subcategory";
this.RadChartEvalSubcategory.PlotArea.XAxis.DataLabelsColumn = "Vendor";
this.RadChartEvalSubcategory.Legend.Appearance.GroupNameFormat = "#VALUE";
this.RadChartEvalSubcategory.DataSource = GetEvaluationSubCategoryScores();
this.RadChartEvalSubcategory.DataBind();

The chart is generated with the Vendors on the x-axis, a bar (Series) for each SubCategory and the values on the y-axis. Works perfectly.

I am now trying to do the same in htmlchart, and it does not seem to be possible to implement in the same way. Cannot find any examples or information on how to do such a simple binding task as was possible before. Would be disappointing if this is not supported anymore.

Is there any way to do the databinding in the same way as it was possible in RadChart?


 

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 20 Feb 2014, 03:30 PM
Hi Tonie,

I am sorry to say that the mentioned grouping functionality is not available in the RadHtmlChart. What I can suggest is that you manually do the grouping of the data source fields and then pass the new data source to the chart.

You can find such an example with a DataTable data source in this forum thread.

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Chart (HTML5)
Asked by
Tonie Venter
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or