4
votes

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?

3

3 Answers

3
votes

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>
2
votes

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).

1
votes

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...