如何设置实时图表的标签颜色?

il *_*ino 4 wpf xaml material-design-in-xaml livecharts

我有一个基于 materialdesigninxaml 框架的应用程序,我可以在其中设置浅色和深色,设置浅色后我可以正确看到黑色的标签文本,但是当我设置深色主题时,图表的标签仍然保留黑色,所以我什么也看不见。这是我的图表:

 <lvc:CartesianChart Series="{Binding}" LegendLocation="Bottom">
       <lvc:CartesianChart.AxisY>
           <lvc:Axis Labels="{Binding AnalysisController.Labels}"/>
       </lvc:CartesianChart.AxisY>
 </lvc:CartesianChart>
Run Code Online (Sandbox Code Playgroud)

我尝试按照文档的建议将其添加到我的 App.xaml 中:

<ResourceDictionary Source="pack://application:,,,/LiveCharts.Wpf;component/Themes/Colors/white.xaml" />
Run Code Online (Sandbox Code Playgroud)

但文字的颜色仍然是黑色

Yvo*_*ila 6

您可以将Foreground轴的设置为另一种颜色,如下所示:

<lvc:CartesianChart Series="{Binding}" LegendLocation="Bottom">
    <lvc:CartesianChart.AxisY>
        <lvc:Axis Labels="{Binding AnalysisController.Labels}"
                  Foreground="White"/>
    </lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
Run Code Online (Sandbox Code Playgroud)