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

Cannot stack bars on barchart

1 Answer 45 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 2
Dave asked on 15 Oct 2015, 09:47 AM

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

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 15 Oct 2015, 10:06 AM

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
Tags
Chart (HTML5)
Asked by
Dave
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or