I am attempting to create a stacked bar chart based on a SQL data source.
The first attachment (before) shows the basic chart, with the values also show on the left for reference. (in a RadGrid)
I then add the second series to the chart definition and get what you see in the second attachment (after)
Note that the scale has changed significantly and it no longer matches the range of values. In this case "future shows" is a fixed value of 5, so the maximum series value for year 2010 would be 33 (28 + 5). As you can see, the scale numbers have no relation to the actual stacked values.
Also note in the code to follow, the two series are presented in the wrong order. For the year 2010, available shows = 28 and future shows = 5 (per the data source) But what is presented on the chart is a short blue bar and a taller green bar (value 28) is exactly the opposite of what the legend indicates.
<
telerik:RadHtmlChart
runat
=
"server"
ID
=
"Year_Chart"
DataSourceID
=
"Year_Summary_Data"
Width
=
"452px"
Height
=
"400px"
OnClientSeriesClicked
=
"OnYearSeriesClick"
Skin
=
"BlackMetroTouch"
>
<
ChartTitle
Text
=
"Shows by Year"
>
<
Appearance
Visible
=
"True"
></
Appearance
>
</
ChartTitle
>
<
Legend
>
<
Appearance
Position
=
"Bottom"
Visible
=
"True"
></
Appearance
>
</
Legend
>
<
PlotArea
>
<
CommonTooltipsAppearance
Shared
=
"true"
Visible
=
"false"
>
<
SharedTemplate
>
<
div
>#= year #</
div
>
</
SharedTemplate
>
</
CommonTooltipsAppearance
>
<
XAxis
DataLabelsField
=
"year"
>
<
TitleAppearance
Text
=
"Year"
Visible
=
"false"
></
TitleAppearance
>
<
LabelsAppearance
RotationAngle
=
"75"
/>
<
MajorGridLines
Visible
=
"false"
></
MajorGridLines
>
<
MinorGridLines
Visible
=
"false"
></
MinorGridLines
>
</
XAxis
>
<
YAxis
>
<
MajorGridLines
Visible
=
"true"
Color
=
"#ffc5bf"
Width
=
"1"
></
MajorGridLines
>
<
MinorGridLines
Visible
=
"false"
></
MinorGridLines
>
</
YAxis
>
<
Series
>
<
telerik:ColumnSeries
Stacked
=
"True"
Name
=
"Available Shows"
DataFieldY
=
"shows"
>
<
LabelsAppearance
Visible
=
"True"
></
LabelsAppearance
>
</
telerik:ColumnSeries
>
<
telerik:ColumnSeries
Stacked
=
"True"
Name
=
"Future Shows"
DataFieldY
=
"future"
>
<
LabelsAppearance
Visible
=
"False"
></
LabelsAppearance
>
</
telerik:ColumnSeries>
</
Series
>
</
PlotArea
>
</
telerik:RadHtmlChart
>