WPF DVC图表轴标签

时间:2013-04-09 06:00:16

标签: wpf xaml visual-studio-2012

我在代码中创建了一个DVC:Chart,如下图所示,如何在图表中添加x轴和y轴标签?

    <DVC:Chart Name="callLogs" 
       Background="SteelBlue" Grid.ColumnSpan="2">

        <DVC:Chart.Series>
            <DVC:ColumnSeries Title="Calls per Hour" 
                IndependentValueBinding="{Binding Path=Key}"
                DependentValueBinding="{Binding Path=Value}">
            </DVC:ColumnSeries>
        </DVC:Chart.Series>
    </DVC:Chart>

提前致谢

1 个答案:

答案 0 :(得分:2)

我已经设法弄明白了:

    <DVC:Chart Name="callLogs" 
       Background="SteelBlue" Grid.ColumnSpan="2">
        <DVC:Chart.Axes>
            <DVC:LinearAxis Orientation="Y" Title="Ammount of calls"/>
            <DVC:LinearAxis Orientation="X" Title="Time (Hours)"/>
        </DVC:Chart.Axes>
        <DVC:Chart.Series>
            <DVC:ColumnSeries Title="Calls per Hour" 
                IndependentValueBinding="{Binding Path=Key}"
                DependentValueBinding="{Binding Path=Value}">
            </DVC:ColumnSeries>
        </DVC:Chart.Series>
    </DVC:Chart>

然而,它为我标记了我的x轴,不知道如何自定义它,所以当我想出来时我会发布新的解决方案。

相关问题