WPF visifire 画出水平直线

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/gxcymz/article/details/80706958
 

  .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);

效果图:

展开阅读全文

没有更多推荐了,返回首页