WPF visifire 画出水平直线

发布时间:2023-12-23 00:50:24
?

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

效果图:

文章来源:https://blog.csdn.net/gxcymz/article/details/80706958
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。