Reputation: 1216
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?
Upvotes: 4
Views: 5284
Reputation: 31
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>
Upvotes: 3
Reputation: 3752
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...
Upvotes: 1
Reputation: 189535
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).
Upvotes: 2