如何设计LiveChart的CartesianChart AxisX标签?

时间:2018-02-08 10:59:38

标签: wpf axis-labels livecharts

我在网上搜索过,但没找到我要找的东西,甚至根本没找到它(到目前为止)。 我有一张笛卡尔图表,我想做的是设计AxisX的标签。我已经看过如何改变它的颜色,例如,通过设置Axis的前景,但是,我想用这种风格实现的是通过对齐标签的内容以他们为中心。看起来非常基本的设置' Horizo​​ntalContentAlignment'到了中心,但我还没弄明白怎么做。

以下是我的示例代码的摘录:

        <lc:CartesianChart LegendLocation="Top">
            <lc:CartesianChart.ChartLegend>
                <local:MonthlySummaryCustomLegendView />
            </lc:CartesianChart.ChartLegend>
            <lc:CartesianChart.AxisX>
                <lc:Axis Title="Days of Month"
                         ShowLabels="True"
                         MaxValue="28"
                         MinValue="1">
                    <lc:Axis.Separator>
                        <lc:Separator Step="1" 
                                      IsEnabled="False">
                        </lc:Separator>
                    </lc:Axis.Separator>
                </lc:Axis>
            </lc:CartesianChart.AxisX>
        </lc:CartesianChart>
        (...)

这是当前呈现方式的屏幕截图:

提前感谢大家,非常感谢任何帮助或指导。

1 个答案:

答案 0 :(得分:0)

我认为没有一种干净简单的方法。

  • 您无法通过可视树真正区分轴标签: Visual Tree
  • 您无法访问TextBlock的{​​{1}}属性而无需反思,因为它内部