LiveCharts 用于显示图表和仪表盘
- 安装 LinveCharts
install-package LiveCharts.Wpf
- 使用示例
Code
<CartesiantChart> <!--图标控件-->
<LineSeries Stroke="#7ADA95" Values="156,60,70,760,320,540,880,340,500"> <!--序列 :序列中设置线的颜色 -->和对应的数值 Y轴
<LineSeries.Fill> <!--图标背景色-->
<LinearGradientBrush StartPoint="0 0" EndPoint="0 1">
<GradientStop Color="#7ADA95" />
<GradientStop Color="White" />
<LinearGradientBrush
<LineSeries.Fill>
</LineSeries>
<!--设置X轴-->
<CartesiantChart.AxisX>
<Axis ShowLabels="true" Labels="1:00,2:00,3:00,4:00,5:00.6:00,7:00,8:00,9:00">
<Axis.Separator Step="1" StrokeThickness="0" />
</Axis>
</CartesiantChart.AxisX>
<!--设置Y轴-->
<CartesiantChart.AxisY>
<Axis ShowLabels="True" FontSize="8" MinValue="0">
<Axis.Separator>
<Separator Step="200" /> <!--设置间隔-->
</Axis.Separator>
</Axis>
<CartesiantChart.AxisY>
</CartesiantChart>