Hello, I have the below working perfectly, however, I need to be able to change the Slice colors based on the Data..
i.e., The High slice should be red, Medium Yellow and Low Green. I can't seem to figure out that piece..
<
telerik:RadHtmlChart
runat
=
"server"
ID
=
"RiskLevelsChart"
Height
=
"400px"
Width
=
"400px"
Transitions
=
"true"
RenderMode
=
"Lightweight"
Skin
=
"Forest"
>
<
Appearance
>
<
FillStyle
BackgroundColor
=
"White"
></
FillStyle
>
</
Appearance
>
<
ChartTitle
>
<
Appearance
Align
=
"Center"
BackgroundColor
=
"White"
Position
=
"Top"
></
Appearance
>
</
ChartTitle
>
<
Legend
>
<
Appearance
BackgroundColor
=
"White"
Position
=
"Right"
Visible
=
"true"
></
Appearance
>
</
Legend
>
<
PlotArea
>
<
Appearance
>
<
FillStyle
BackgroundColor
=
"White"
></
FillStyle
>
</
Appearance
>
<
Series
>
<
telerik:PieSeries
StartAngle
=
"90"
dataFieldY
=
"RiskLevelCount"
NameField
=
"RiskLevelName"
Name
=
"RiskLevelName"
>
<
LabelsAppearance
Position
=
"Circle"
DataFormatString
=
"{0} %"
DataField
=
"RiskLevelName"
ClientTemplate
=
"#=dataItem.RiskLevelName# (#=dataItem.RiskLevelCount#)"
>
</
LabelsAppearance
>
<
TooltipsAppearance
ClientTemplate
=
" #=kendo.format(\'{0:P0}\', percentage)# "
Visible
=
"true"
/>
</
telerik:PieSeries
>
</
Series
>
</
PlotArea
>
</
telerik:RadHtmlChart
>
Private
Sub
DoChart1(
ByVal
Assessment
As
List(Of ExtendedRiskAssessment))
Dim
query = From r
In
Assessment
Dim
HighQuery = Assessment.Where(
Function
(x) x.RiskLevel = 3).Count
Dim
MediumQuery = Assessment.Where(
Function
(x) x.RiskLevel = 2).Count
Dim
LowQuery = Assessment.Where(
Function
(x) x.RiskLevel = 1).Count
Dim
risklevels
As
New
List(Of RiskLevel)()
risklevels.Add(
New
RiskLevel(Master.GetTranslation(
"High"
).ToString, HighQuery, Color.Red))
risklevels.Add(
New
RiskLevel(Master.GetTranslation(
"Medium"
).ToString, MediumQuery, Color.Yellow))
risklevels.Add(
New
RiskLevel(Master.GetTranslation(
"Low"
).ToString, LowQuery, Color.Green))
RiskLevelsChart.ChartTitle.Text = Master.GetTranslation(
"RiskLevels"
).ToString
RiskLevelsChart.DataSource = risklevels
RiskLevelsChart.DataBind()
End
Sub