This question is locked. New answers and comments are not allowed.
I have this chart in my xaml:
And I have this in my code-behind:
But when LoadPieChartData is called my piechart becomes a barchart. What did I do?
<
control:RadChart
MaxHeight
=
"200"
MaxWidth
=
"200"
HorizontalAlignment
=
"Left"
x:Name
=
"Chart2"
>
<
control:RadChart.DefaultView
>
<
chart:ChartDefaultView
>
<!--ChartArea-->
<
chart:ChartDefaultView.ChartArea
>
<!--ChartArea-->
<
chart:ChartArea
x:Name
=
"PieChart1"
>
<
chart:ChartArea.DataSeries
>
<
chart:DataSeries
>
<
chart:DataSeries.Definition
>
<
chart:PieSeriesDefinition
/>
</
chart:DataSeries.Definition
>
<
chart:DataPoint
YValue
=
"15"
/>
<
chart:DataPoint
YValue
=
"5"
/>
<
chart:DataPoint
YValue
=
"34"
/>
<
chart:DataPoint
YValue
=
"11"
/>
<
chart:DataPoint
YValue
=
"15"
/>
<
chart:DataPoint
YValue
=
"25"
/>
</
chart:DataSeries
>
</
chart:ChartArea.DataSeries
>
</
chart:ChartArea
>
</
chart:ChartDefaultView.ChartArea
>
</
chart:ChartDefaultView
>
</
control:RadChart.DefaultView
>
</
control:RadChart
>
And I have this in my code-behind:
private
void
LoadPieChartData(MyType myRow)
{
if
(myRow !=
null
)
{
List<
double
> pieList =
new
List<
double
>();
pieList.Add(myRow.Col1);
pieList.Add(myRow.Col2);
pieList.Add(myRow.Col3);
Chart2.ItemsSource = pieList;
}
}
But when LoadPieChartData is called my piechart becomes a barchart. What did I do?