我无法让我的图例显示标签以外的任何内容。它不会显示颜色形状。堆积条形图可以正确显示。你能看看我的XAML代码,告诉我我做错了什么吗?我对此进行了广泛的研究,我的代码似乎与我在网上找到的例子相符。感谢。
<telerikPrimitives:RadLegendControl LegendProvider="{Binding ElementName=BarChart}"
x:Name="legend"
RelativePanel.Below="BarChart"
RelativePanel.AlignLeftWithPanel="True">
<telerikPrimitives:RadLegendControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal">
</StackPanel>
</ItemsPanelTemplate>
</telerikPrimitives:RadLegendControl.ItemsPanel>
</telerikPrimitives:RadLegendControl>
<telerikChart:RadCartesianChart Name="BarChart" PaletteName="DefaultDark" RelativePanel.Below="pieChart" Width="400" Height="400">
<telerikChart:RadCartesianChart.HorizontalAxis>
<telerikChart:CategoricalAxis />
</telerikChart:RadCartesianChart.HorizontalAxis>
<telerikChart:RadCartesianChart.VerticalAxis>
<telerikChart:LinearAxis />
</telerikChart:RadCartesianChart.VerticalAxis>
<telerikChart:RadCartesianChart.Grid>
<telerikChart:CartesianChartGrid MajorLinesVisibility="Y" StripLinesVisibility="Y" />
</telerikChart:RadCartesianChart.Grid>
<telerikChart:BarSeries ItemsSource="{Binding MyData, Mode=TwoWay}" CombineMode="Stack" LegendTitle="Ready" IsVisibleInLegend="True">
<telerikChart:BarSeries.ValueBinding>
<telerikChart:PropertyNameDataPointBinding PropertyName="Value"/>
</telerikChart:BarSeries.ValueBinding>
<telerikChart:BarSeries.CategoryBinding>
<telerikChart:PropertyNameDataPointBinding PropertyName="Evaluator"/>
</telerikChart:BarSeries.CategoryBinding>
</telerikChart:BarSeries>
<telerikChart:BarSeries ItemsSource="{Binding MyData2, Mode=TwoWay}" CombineMode="Stack" LegendTitle="Not Ready" IsVisibleInLegend="True">
<telerikChart:BarSeries.ValueBinding>
<telerikChart:PropertyNameDataPointBinding PropertyName="Value"/>
</telerikChart:BarSeries.ValueBinding>
<telerikChart:BarSeries.CategoryBinding>
<telerikChart:PropertyNameDataPointBinding PropertyName="Evaluator"/>
</telerikChart:BarSeries.CategoryBinding>
</telerikChart:BarSeries>
</telerikChart:RadCartesianChart>