3
Vote

Chart with pie series: BindingExpression error with ActualLegendItemStyle

description

When creating a simple pie chart, similar to the examples one would find online, one gets BindingExpression errors on the output window:
 
System.Windows.Data Error: BindingExpression path error: 'ActualLegendItemStyle' property not found on 'System.Windows.Controls.DataVisualization.Charting.PieSeries' 'System.Windows.Controls.DataVisualization.Charting.PieSeries' (HashCode=24163637). BindingExpression: Path='ActualLegendItemStyle' DataItem='System.Windows.Controls.DataVisualization.Charting.PieSeries' (HashCode=24163637); target element is 'System.Windows.Controls.DataVisualization.Charting.LegendItem' (Name=''); target property is 'Style' (type 'System.Windows.Style')
 
The sample code to generate the chart looks like this:
<chartingToolkit:Chart>
        <chartingToolkit:Chart.Series>
            <chartingToolkit:PieSeries>
                <chartingToolkit:PieSeries.ItemsSource>
                    <controls:ObjectCollection>
                        <sys:Double>1</sys:Double>
                        <sys:Double>2.3</sys:Double>
                        <sys:Double>3.5</sys:Double>
                        <sys:Double>5</sys:Double>
                    </controls:ObjectCollection>
                </chartingToolkit:PieSeries.ItemsSource>
            </chartingToolkit:PieSeries>
        </chartingToolkit:Chart.Series>
    </chartingToolkit:Chart>
 
This has also been reported with the Silverlight version with the charts:
http://forums.silverlight.net/forums/t/153144.aspx

comments