首页 文章

WPF工具包图表上的辅助y轴

提问于
浏览
4

我想在WPF工具包图表中绘制两个系列 . (http://wpf.codeplex.com/)我可以将一个数据系列的Y轴设置为辅助y轴吗?

3 回答

  • 1

    是 . Axis 类型具有 Location 属性,您可以使用该属性指定它应显示在左侧或右侧(或顶部或底部) .

  • 1

    刚刚找到了一个简单的方法(但不容易找到!)

    在第一个系列(我的例子中的ColumnSerie)上,添加它

    <DVC:ColumnSeries.DependentRangeAxis >
        <DVC:LinearAxis Location="Left" Orientation="Y" />
    </DVC:ColumnSeries.DependentRangeAxis>
    

    在第二个系列(LineSeries)上,添加此项

    <DVC:LineSeries.DependentRangeAxis >
        <DVC:LinearAxis Location="Right" Orientation="Y" />
    </DVC:LineSeries.DependentRangeAxis>
    
  • 3

    您可以使用Location属性作为轴定义 . 像这样:

    <charts:LinearAxis Orientation="Y"
        Title="Some (Units)"
        Minimum="0"
        Maximum="40"
        Interval="5"
        Location="Right"/>
    

    这也可以是“左”,“上”,“下”或“自动”,自动是默认值,如果你定义第二个轴,这将默认为左边画一个,右边画第二个(至少用2010年2月发布) .

    希望这可以帮助...

相关问题