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

StackBar Chart grouping, dataSource groping

1 Answer 50 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Vladyslav
Top achievements
Rank 1
Vladyslav asked on 07 Mar 2015, 01:23 PM
Hello,
I have a question related to stackbar charts.

I have 2 series and dataSoursce grouping.
I'm trying to use 'StackBar style' on one of series, but I want to keep another in 'bar style'.

And I have a following problem.
Those columns are stacked. Even if I'm trying to disable second series.

Please have a look here:
http://jsfiddle.net/fyJys/712/

I need a chart that will look like something like this:
http://dojo.telerik.com/OGImU

but with first example configuration.

Is it possible?

Thanks,
Vlad.



1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 11 Mar 2015, 07:09 AM
Hi,

The first example is using a rather old version from 2012.
It's bound to have some problems so I've updated the snippet.

We need to assign a named stack for the second series to make it clear that we don't want to share the same stack.
  series: [{
    type: "column",
    field: "Expense",
    stack: 'group_1'
  },{
    type: "column",
    field: "Expense",
    stack: "group_2"
  }]

We don't check specifically for false and treat "stack: false" as undefined.
This is worth investigating as we have a clearly stated intent that shouldn't be ignored.

This gets us somewhere, but the grouping will generate two series for the second group.
Not sure if this is the desired result.

An alternative would be to update the stack setting on the series after grouping has been done.
The dataBound event gives us opportunity do this. See this snippet for a demo.

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