How to display result with stacked bar ?

Thread is closed for posting
4 posts, 0 answers
  1. Madhu Palakurthi
    Madhu Palakurthi avatar
    48 posts
    Member since:
    Nov 2009

    Posted 02 Jan 2013 Link to this post


    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 ..
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Jan 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Madhu Palakurthi
    Madhu Palakurthi avatar
    48 posts
    Member since:
    Nov 2009

    Posted 03 Jan 2013 Link to this post

    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 ..
  5. Madhu Palakurthi
    Madhu Palakurthi avatar
    48 posts
    Member since:
    Nov 2009

    Posted 03 Jan 2013 Link to this post

    Hi Princy,

    If I use your code then getting error is : value was either too large or too small for a decimal
Back to Top