wpf使用livecharts---曲线隐藏/虚线化方格线(X/Y轴)、去掉阴影
隐藏X轴,Y轴显示虚线:
<lvc:CartesianChart Grid.Row="2" Grid.Column="0" Name="cartesianChart1" DisableAnimations="True" Visibility="Hidden" Hoverable="False" DataTooltip="{x:Null}" Margin="20,20,0,20" Series="{Binding SeriesCollection1}" LegendLocation="None"> <lvc:CartesianChart.AxisX> <lvc:Axis Labels="{Binding Labels1}" FontSize="12" LabelsRotation="0" DisableAnimations="True"> <lvc:Axis.Separator> <lvc:Separator Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="#404F56" > </lvc:Separator> </lvc:Axis.Separator> </lvc:Axis> </lvc:CartesianChart.AxisX> <lvc:CartesianChart.AxisY> <lvc:Axis> <lvc:Axis.Separator> <lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Step="{Binding AxisStep}" Stroke="#404F56" > </lvc:Separator> </lvc:Axis.Separator> </lvc:Axis> </lvc:CartesianChart.AxisY> </lvc:CartesianChart>
去掉阴影:
直接设置Fill属性为透明即可:
前台设置:Fill=“transparent”;
后台控制:
//曲线阴影区域不显示背景色 var fill = new SolidColorBrush(); fill.Opacity = 1; LineSeries setTemp = new LineSeries(); setTemp.Fill = fill;