I need to display what should be a pretty basic Pie Chart, but am having trouble with the Labels.
The data is all coming from a SQL database, and it's only two columns. The "Chart Label" is a pre-calculated Label that I'd like to use on each slice of the pie chart. Occurences are, the values that the chart will be.... charting....
--------------------------------------
Occurrences | Chart Label
--------------------------------------
2 | Item Label 1 (2)
5 | Item Label 2 (5)
6 | Item Label 3 (6)
2 | Item Label 4 (2)
3 | Item Label 5 (3)
So in my ASPX code, I have the following:
Note that I'm trying to bind the label text to the "Chart Label" field. Am I going about this in the wrong way, because it is not working... instead, the label is displaying the value in the "Occurrences" field.
Even if I go into the Chart Wizard to set the Label field to "Chart Label" - nothing happens and the value is not saved.
Thanks!
Nick
The data is all coming from a SQL database, and it's only two columns. The "Chart Label" is a pre-calculated Label that I'd like to use on each slice of the pie chart. Occurences are, the values that the chart will be.... charting....
--------------------------------------
Occurrences | Chart Label
--------------------------------------
2 | Item Label 1 (2)
5 | Item Label 2 (5)
6 | Item Label 3 (6)
2 | Item Label 4 (2)
3 | Item Label 5 (3)
So in my ASPX code, I have the following:
<telerik:RadChart ID="RadChart1" runat="server" DataSourceID="SqlDataSource1" DefaultType="Pie" Skin="WebBlue" IntelligentLabelsEnabled="True" AutoTextWrap="True" AutoLayout="True" SeriesOrientation="Horizontal"> |
<Series> |
<telerik:ChartSeries DataLabelsColumn="ChartLabel" DataYColumn="Occurrences" Name="Occurrences" Type="Pie"> |
<Appearance> |
<LabelAppearance Distance="15"> |
</LabelAppearance> |
<Border Color="73, 86, 101" /> |
<TextAppearance TextProperties-Color="140, 140, 140"> |
</TextAppearance> |
<FillStyle FillType="ComplexGradient" MainColor="94, 117, 142"> |
<FillSettings> |
<ComplexGradient> |
<telerik:GradientElement Color="94, 117, 142" /> |
<telerik:GradientElement Color="116, 138, 162" Position="0.5" /> |
<telerik:GradientElement Color="139, 160, 183" Position="1" /> |
</ComplexGradient> |
</FillSettings> |
</FillStyle> |
</Appearance> |
</telerik:ChartSeries> |
</Series> |
... |
</telerik:RadChart> |
... |
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" |
SelectCommand="SELECT COUNT(*) AS [Occurrences], incidentCode + ' (' + CAST(COUNT(*) AS nvarchar) + ')' AS [ChartLabel] FROM Incidents GROUP BY incidentCode"> |
</asp:SqlDataSource> |
... |
Note that I'm trying to bind the label text to the "Chart Label" field. Am I going about this in the wrong way, because it is not working... instead, the label is displaying the value in the "Occurrences" field.
Even if I go into the Chart Wizard to set the Label field to "Chart Label" - nothing happens and the value is not saved.
Thanks!
Nick