This question is locked. New answers and comments are not allowed.
Hello,
I am using MVVM to bind a PieChart to a collection called "Metrics" as shown below. The collection has a "Count" and a "Status" field. The status field is used on the legend, and based on the value in "Status" I would like to color that series a particular color.
Could I add a color property to my "Metrics" collection and somehow bind the pie chart's series color to that property? I don't see anything that allows that in ItemMappings. If not, how else would someone recommend setting the color dynamically based on "Status?" Can I create a predefined map? Thanks.
I am using MVVM to bind a PieChart to a collection called "Metrics" as shown below. The collection has a "Count" and a "Status" field. The status field is used on the legend, and based on the value in "Status" I would like to color that series a particular color.
Could I add a color property to my "Metrics" collection and somehow bind the pie chart's series color to that property? I don't see anything that allows that in ItemMappings. If not, how else would someone recommend setting the color dynamically based on "Status?" Can I create a predefined map? Thanks.
<
chart:RadChart
Grid.Row
=
"1"
ItemsSource
=
"{Binding Metrics}"
BorderThickness
=
"0"
>
<
chart:RadChart.SeriesMappings
>
<
charting:SeriesMapping
>
<
charting:SeriesMapping.SeriesDefinition
>
<
charting:PieSeriesDefinition
/>
</
charting:SeriesMapping.SeriesDefinition
>
<
charting:ItemMapping
FieldName
=
"Count"
DataPointMember
=
"YValue"
/>
<
charting:ItemMapping
FieldName
=
"Status"
DataPointMember
=
"LegendLabel"
/>
</
charting:SeriesMapping
>
</
chart:RadChart.SeriesMappings
>