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">

    <Appearance>

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

    </Appearance>

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

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

    <SeriesItems>

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

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

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

    </SeriesItems>

    </telerik:ColumnSeries>


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

    <Appearance>

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

    </Appearance>

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

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

    <SeriesItems>

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

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

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

    </SeriesItems>

    </telerik:ColumnSeries>
    My dataset looks like this:

    day       app              avg

    Tue       Outlook       10

    Tue       Word             4

    Tue       Excel            7

    Wed     Outlook        2

    etc..

    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
    Admin
    Danail Vasilev avatar
    1493 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

    Regards,
    Danail Vasilev
    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