SQL databound RADHTML stacked column chart

2 posts, 0 answers
  1. Travis
    Travis avatar
    1 posts
    Member since:
    Aug 2015

    Posted 19 Aug 2015 Link to this post

    I can easily create a databound chart if it’s a simply scenario like totals by month and I’ve already provided the high level grouping in the SQL. But I want to do something like, totals by month by app, and have it be a stacked chart w/ the apps as the series, I don’t know how to do that. I specify from my sql data source the column for the app name (app), and I specify the label (ie Outlook). How in the Category series Item section can I get it to recognize my datafield, and also have it filter on values that only = ‘Outlook’? The example below for the series item sets the values  to a static value.

                        <telerik:ColumnSeries DataFieldY="app" Name="Outlook" Stacked="false" Gap="1.5" Spacing="0.4">


    <FillStyle BackgroundColor="#d5a2bb"></FillStyle>


    <LabelsAppearance DataFormatString="{0}" Position="OutsideEnd"></LabelsAppearance>

    <TooltipsAppearance DataFormatString="{0}" Color="White"></TooltipsAppearance>


    <telerik:CategorySeriesItem Y="25000"></telerik:CategorySeriesItem>

    <telerik:CategorySeriesItem Y="12000"></telerik:CategorySeriesItem>

    <telerik:CategorySeriesItem Y="39000"></telerik:CategorySeriesItem>



    //snippet for the below chart
    <telerik:ColumnSeries Name="Lounge">


    <FillStyle BackgroundColor="#850071"></FillStyle>


    <LabelsAppearance DataFormatString="{0} sales" Position="OutsideEnd"></LabelsAppearance>

    <TooltipsAppearance DataFormatString="{0} sales" Color="White"></TooltipsAppearance>


    <telerik:CategorySeriesItem Y="15000"></telerik:CategorySeriesItem>

    <telerik:CategorySeriesItem Y="23000"></telerik:CategorySeriesItem>

    <telerik:CategorySeriesItem Y="10000"></telerik:CategorySeriesItem>


    My dataset looks like this:

    day       app              avg

    Tue       Outlook       10

    Tue       Word             4

    Tue       Excel            7

    Wed     Outlook        2


    I want this chart to look like online demo example, but instead of Wooden Table, Lounge, etc, it would list the values in the ‘app’ column of my dataset.

  2. Danail Vasilev
    Danail Vasilev avatar
    1502 posts

    Posted 24 Aug 2015 Link to this post

    Hi Travis,

    Data source grouping is not supported by the chart out of the box and should be done manually. You may find such an example in the following code library - http://www.telerik.com/support/code-library/group-radhtmlchart-data-source

    Danail Vasilev
    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
Back to Top