WPF LiveChart如何删除Piechart系列的白色边框

时间:2019-05-09 14:13:04

标签: wpf pie-chart livecharts borderless

我有一个WPF-LiveChart(lvcharts.net)PieSeries图表,但其中包含白色边框。如何删除这些白色背景。请参见代码

<lvc:PieChart  Visibility="Visible"  Name="TestCaseChart" Grid.Row="0"   Grid.Column="1" Series="{Binding SeriesCollection}" InnerRadius="100" Width="180" Height="180" BorderThickness="0"  BorderBrush="Transparent"></lvc:PieChart>

我尝试了BorderBrush和BorderThickness属性,但是Chart没有采用这些属性。基本上我的Screen背景是黑色的,因此在这些图表系列中看到白色背景很尴尬。

1 个答案:

答案 0 :(得分:1)

尝试一下:

  <lvc:PieChart LegendLocation="Bottom" DataClick="Chart_OnDataClick" Hoverable="False" DataTooltip="{x:Null}" ScrollBarFill="{x:Null}">
        <lvc:PieChart.Series>
            <lvc:PieSeries Title="Maria" Values="13" DataLabels="True"
                           LabelPoint="{Binding PointLabel}" Stroke="{x:Null}" StrokeThickness="0"/>
            <lvc:PieSeries Title="Charles" Values="4" DataLabels="True" 
                           LabelPoint="{Binding PointLabel}" Foreground="{x:Null}" Stroke="{x:Null}"  StrokeThickness="0"/>
            <lvc:PieSeries Title="Frida" Values="6" DataLabels="True" 
                           LabelPoint="{Binding PointLabel}" Foreground="{x:Null}" Stroke="{x:Null}"  StrokeThickness="0"/>
            <lvc:PieSeries Title="Frederic" Values="2" DataLabels="True" 
                           LabelPoint="{Binding PointLabel}" Foreground="{x:Null}" Stroke="{x:Null}"  StrokeThickness="0"/>
        </lvc:PieChart.Series>
    </lvc:PieChart>