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

SQL databound RADHTML stacked column chart

1 Answer 144 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Travis
Top achievements
Rank 1
Travis asked on 19 Aug 2015, 04:32 PM

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.

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 24 Aug 2015, 12:49 PM
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
Tags
Chart (HTML5)
Asked by
Travis
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or