two chart series in a stacked bar chart

Thread is closed for posting
6 posts, 0 answers
  1. Adrian Wright
    Adrian Wright avatar
    6 posts
    Member since:
    Jul 2012

    Posted 13 Jul 2009 Link to this post

    Hi there,

    For our application we are trying to show two series of data in a stacked bar chart, each series contains 2 items. We are finding a problem where we are getting both series items being displayed within the same stacked bar, so rather than having 2 items per bar...we have 4.

    If we use the group databinding feature on a normal bar chart it seems to be working fine but under stacked bar chart type we are encountering problems

    Hope you can help

  2. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 13 Jul 2009 Link to this post

    Hi Adrian,

    Not sure if this is the answer, but I'm in the middle of building the same type of chart programatically, and found I had to have the initial Chart definitions outside of my loop, eg:

     Dim cs_hours As New ChartSeries  
                        cs_hours.Name = "Hours Recorded" 
                        Dim cs_under As New ChartSeries  
                        cs_under.Name = "Hours Deficit" 
                        Dim cs_over As New ChartSeries  
                        cs_over.Name = "Hours Over" 
                        cs_hours.Type = ChartSeriesType.StackedBar  
                        cs_under.Type = ChartSeriesType.StackedBar  
                        cs_over.Type = ChartSeriesType.StackedBar  
                        While dr.Read  
                            Dim tm As String = dr.Item(0)  
                            Dim hrs As Decimal = dr.Item(1)  
                            Dim ehrs As Decimal = dr.Item(2)  
                            cs_hours.AddItem(ah, "", Drawing.Color.Green)  
                            cs_under.AddItem(vh, "", Drawing.Color.Blue)  
                            cs_over.AddItem(rh, "", Drawing.Color.Red)  
                        End While 

    I had initially put all the initialisation code for the Chart inside the read loop, which resulted in what you seem to be getting.

    David Penny
  3. DevCraft R3 2016 release webinar banner
  4. Adrian Wright
    Adrian Wright avatar
    6 posts
    Member since:
    Jul 2012

    Posted 13 Jul 2009 Link to this post

    Hi there and thanks for the swift reply!

    The way we are creating the charts is done in the way that you have posted, but still no luck on our ends.. what we are trying to implement is something similar to what is shown in this link Silverlight stacked bar chart example. Unfortunately its implemented in Silverlight controls but we are hoping that it can be implemented the same using the stacked bar chart ( controls

  5. Vladimir Milev
    Vladimir Milev avatar
    1061 posts

    Posted 15 Jul 2009 Link to this post

    Hello Adrian Wright,

    I think you are referring to the StackGroups feature of our Silverlight chart. Unfortunately RadChart for ASP.NET does not allow you to have more than one stack group.

    We apologize for this inconvenience.

    Best wishes,
    Vladimir Milev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
    VINEET avatar
    10 posts
    Member since:
    Aug 2011

    Posted 02 Jun 2012 Link to this post

    Hello Telerik Team,
    Is this possible to have more then one Stack Group in Chart Control.
  7. Rosko
    Rosko avatar
    137 posts

    Posted 06 Jun 2012 Link to this post

    Hi Vineet,

    It is possible only in WPF and Silverlight. Unfortunately, it is not possible in ASP.NET. Thee good thing is that you can integrate RadChart for Silverlight in an ASP.NET application. You can find an online example demonstrating the integration in action online.

    the Telerik team
    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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
DevCraft R3 2016 release webinar banner