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

6 posts, 0 answers
  1. JL
    JL avatar
    1 posts
    Member since:
    May 2013

    Posted 11 Mar 2014 Link to this post

       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
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 12 Mar 2014 Link to this post

    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.

     
  3. Kendo UI is VS 2017 Ready
  4. Luca
    Luca avatar
    11 posts
    Member since:
    Jul 2012

    Posted 07 Jan in reply to T. Tsonev Link to this post

    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

     

  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 12 Jan Link to this post

    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!
     
  6. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 13 Jan Link to this post

    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!
     
  7. Luca
    Luca avatar
    11 posts
    Member since:
    Jul 2012

    Posted 13 Jan Link to this post

    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

Back to Top
Kendo UI is VS 2017 Ready