Experts,
i m new to charting.i am using the WPF charting toolkit and took help form this blog:
in XAML i m using
<chartingToolkit:Chart x:Name="ChartPie" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="5,0,0,0"
Title="{Binding Path=Title}" LegendTitle="{Binding Path=LegendTitle}" Visibility="{Binding IsPiechart}" >
<chartingToolkit:PieSeries x:Name="XPieSeries"
DataContext="{Binding}" DependentValueBinding="{Binding Path=Value}" IndependentValueBinding="{Binding Path=Key}" ItemsSource="{Binding Path=dataPie}" Visibility="{Binding IsPiechart}" />
</chartingToolkit:Chart>
and in the View model i am just updating the observalbe collcection "dataPie".
private ObservableCollection<KeyValuePair<string, double>> _dataPie = new ObservableCollection<KeyValuePair<string, double>>();
public ObservableCollection<KeyValuePair<string, double>> dataPie
{
get { return _dataPie; }
set { _dataPie = value; }
}
dataPie.Add(new KeyValuePair<string, double>("Yes", resultdiv));
dataPie.Add(new KeyValuePair<string, double>("No", (100 - resultdiv)));
but how can i control the color in the pie chart. every time the chart refreshes the color is changing. please let me know how to control the color.
thanks in advance.