.xaml:
<vc:Chart Width="400" Height="300" BorderThickness="0,1,1,1">
<vc:Chart.Legends >
<vc:Legend VerticalAlignment="Center" HorizontalAlignment="Right" />
</vc:Chart.Legends>
<vc:Chart.Series>
<vc:DataSeries RenderAs="Pie">
<vc:DataSeries.DataPoints>
<vc:DataPoint Name="pieZC" LegendText="正常" ShowInLegend="True" AxisXLabel="正常"></vc:DataPoint>
<vc:DataPoint Name="pieJX" LegendText="畸形" ShowInLegend="True" AxisXLabel="畸形"></vc:DataPoint>
<vc:DataPoint Name="pieSW" LegendText="死亡" ShowInLegend="True" AxisXLabel="死亡"></vc:DataPoint>
</vc:DataSeries.DataPoints>
</vc:DataSeries>
</vc:Chart.Series>
</vc:Chart>
.cs:
TrendLine tl = new TrendLine();
tl.Value = i;
tl.LineThickness=0.1;
tl.LineColor = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0)); MyChart.TrendLines.Add(tl);
效果图: