开发者

secondary y axis on WPF toolkit chart

I want to plot two line series in a WPF toolkit chart. (http://wpf.codeplex.com/) Can 开发者_开发问答I set Y-axis of one data series as a secondary y-axis?


Just found an easy way to do this (but not easy to find !)

On the first serie (ColumnSerie on my example), add this

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

On the second serie (LineSeries), add this

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


Yes. The Axis type has a Location property you can use to specify that it should appear on the Left or Right (or Top or Bottom).


You can use the Location property for the axis definition. Like so:

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

This can also be "Left" "Top" "Bottom" or "Auto", Auto is the default and if you define a second axis this will default to drawing one on the left and a second one on the right (at least with the February 2010 release).

Hope this helps...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜