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

Stacked and grouped bar chart where both stack and group are properties

5 Answers 482 Views
Charts
This is a migrated thread and some comments may be shown as answers.
JL
Top achievements
Rank 1
JL asked on 11 Mar 2014, 10:32 PM
   Hi there,
   Is that possible to create a chart in the same way which is shown in this example (http://demos.telerik.com/kendo-ui/dataviz/bar-charts/grouped-stacked-bar.html) but where both stack and group properties are read from a JSON file?
  I'm not able to set "stack" property from data loaded from datasource.
  Thanks in advance for your response.
   Best regards.
JL

5 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 12 Mar 2014, 11:25 AM
Hello,

A bindable stack field is on our to-do list and we hope to have it implemented soon.
For the time being you need to process the data manually and build the series in advance.

Apologies for the caused inconvenience.

Regards,
T. Tsonev
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Luca
Top achievements
Rank 1
Iron
answered on 07 Jan 2016, 10:33 PM

Hi,

 Has this been added in the new version of Kendo UI? I've got the same problem, I need to bind both series and stacks from JSON in order to have the same result of your grouped-stacked-bar DEMO.

 Also it would been nice to have the ability to add an array of colors by serie, since the stack is bound from remote data, the number of them can always change.

 

 

Thanks

Luca

 

0
T. Tsonev
Telerik team
answered on 12 Jan 2016, 02:45 PM
Hi,

It turned out it's not practical to implement a stack field in the way we saw it initially.
Our recommendation is to use series grouping and assign stacks in the dataBound event:
        dataBound: function(e) {
          var series = e.sender.options.series;
          for (var i = 0; i < series.length; i++) {
            series[i].stack = series[i].data[0].stack;
          }
        }

This assumes all data points in a series have the same stack.

See this snippet for a demo.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
T. Tsonev
Telerik team
answered on 13 Jan 2016, 07:21 AM
Hello,

I've created a how-to article for this scenario as well. See Stacked and Grouped Series Bound to Remote Data.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Luca
Top achievements
Rank 1
Iron
answered on 13 Jan 2016, 02:02 PM

Hello

Thank you so much for your quick reply and the new post on the Documentation library.

 This is exactly what I was looking for.

Best Regards

Luca

Tags
Charts
Asked by
JL
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Luca
Top achievements
Rank 1
Iron
Share this question
or