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

How to display result with stacked bar ?

3 Answers 86 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Madhu Palakurthi
Top achievements
Rank 1
Madhu Palakurthi asked on 03 Jan 2013, 02:50 AM

Hi,

I have a result like this ....

Unit

Dec-12

Jan-13

GrandTotal

000

0

2

2

001

34

0

34

002

12

0

12

003

12

0

12

006

22

0

22

007

10

0

10

ACC

22

0

22

CLM

45

0

45

ESSP

917

9

926

IT

162

0

162

NBDU

602

0

602

OP

22

0

22

ORP

117

0

117

RI

10

0

10

SM

80

0

80


How to bind above result to chart ( stacked bar )

Desired result is :   Grand Total no need ..

 



Thank you in advance ..

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Jan 2013, 05:22 AM
Hi,

Try the following code snippet to achieve your scenario.

ASPX:
<telerik:RadChart ID="RadChart1" runat="server">
    <PlotArea>
        <XAxis DataLabelsColumn="Unit">
        </XAxis>
    </PlotArea>
    <Series>
        <telerik:ChartSeries Type="StackedBar" Name="Dec-12" DataYColumn="Dec-12">
            <Appearance>
                <FillStyle MainColor="Red">
                </FillStyle>
            </Appearance>
        </telerik:ChartSeries>
        <telerik:ChartSeries Type="StackedBar" Name="Jan-13" DataYColumn="Jan-13">
            <Appearance>
                <FillStyle MainColor="green">
                </FillStyle>
            </Appearance>
        </telerik:ChartSeries>
    </Series>
</telerik:RadChart>

C#:
RadChart1.DataSource = Data;
RadChart1.DataBind();

Hope this helps.

Regards,
Princy.
0
Madhu Palakurthi
Top achievements
Rank 1
answered on 03 Jan 2013, 06:00 AM
Hi,

Thank you for quick reply.

Month columns like Dec-2012, Jan-2013 are not static.. i.e may have two or more columns.
Ex:  There is a chance to get columns like this Unit,Dec-2012,Jan-2013,Feb-2013,Mar-2013.

So Whatever u have given above Dec-2013,Jan-2013 in the series are hard coded.. Is it work for two or more Month Columns ?

Thanks ..
0
Madhu Palakurthi
Top achievements
Rank 1
answered on 03 Jan 2013, 08:36 AM
Hi Princy,

If I use your code then getting error is : value was either too large or too small for a decimal
Tags
Chart (Obsolete)
Asked by
Madhu Palakurthi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Madhu Palakurthi
Top achievements
Rank 1
Share this question
or