Cannot stack bars on barchart

2 posts, 0 answers
  1. Dave
    Dave avatar
    25 posts
    Member since:
    Aug 2012

    Posted 15 Oct 2015 Link to this post

    Hi guys,

    I am a bit puzzled by this one, I followed the demos and read the help file but cannot get the bars to be stacked. Here is my code:

    <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" >
        <PlotArea>
            <Series>
                <telerik:BarSeries GroupName="Project" Stacked="true">
                    <Items>
                        <telerik:SeriesItem Name="ORP" YValue="8" />
                        <telerik:SeriesItem Name="Concept" YValue="42" />
                        <telerik:SeriesItem Name="Development" YValue="238" />
                        <telerik:SeriesItem Name="Industrialization" YValue="128" />
                        <telerik:SeriesItem Name="Launch" YValue="87" />
                        <telerik:SeriesItem Name="Post-Launch" YValue="36" />
                        <telerik:SeriesItem Name="Closure" YValue="6" />
                    </Items>
                </telerik:BarSeries>
            </Series>
        </PlotArea>
    </telerik:RadHtmlChart>

    Do you have any clue why I cannot stack this serie?

    Best Regards,
    David

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 15 Oct 2015 Link to this post

    Hello David,

    RadHtmlChart can stack items with matching categories from different series but not the items from the same series. This is why we called the features Stacked Series.

    You can see the stack effect by adding another series. Here is a basic example where I copied the first series and changed its color to red:

    <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server">
        <PlotArea>
            <Series>
                <telerik:BarSeries GroupName="Project" Stacked="true">
                    <Items>
                        <telerik:SeriesItem Name="ORP" YValue="8" />
                        <telerik:SeriesItem Name="Concept" YValue="42" />
                        <telerik:SeriesItem Name="Development" YValue="238" />
                        <telerik:SeriesItem Name="Industrialization" YValue="128" />
                        <telerik:SeriesItem Name="Launch" YValue="87" />
                        <telerik:SeriesItem Name="Post-Launch" YValue="36" />
                        <telerik:SeriesItem Name="Closure" YValue="6" />
                    </Items>
                </telerik:BarSeries>
                <telerik:BarSeries GroupName="Project">
                <Appearance FillStyle-BackgroundColor="Red"></Appearance>
                    <Items>
                        <telerik:SeriesItem Name="ORP" YValue="8" />
                        <telerik:SeriesItem Name="Concept" YValue="42" />
                        <telerik:SeriesItem Name="Development" YValue="238" />
                        <telerik:SeriesItem Name="Industrialization" YValue="128" />
                        <telerik:SeriesItem Name="Launch" YValue="87" />
                        <telerik:SeriesItem Name="Post-Launch" YValue="36" />
                        <telerik:SeriesItem Name="Closure" YValue="6" />
                    </Items>
                </telerik:BarSeries>
            </Series>
        </PlotArea>
    </telerik:RadHtmlChart>

    Regards,

    Marin Bratanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top