Multiple axes

Oystein Bjorke 4 years ago • updated by Henrik Erevik Riise 1 year ago 1
This discussion was imported from CodePlex

Ivan_kol wrote at 2013-07-13 15:02:

I want to display two graphs, the X-axis have a common Y-axis are different.
They need to be displayed in different areas, ie to a schedule does not run into the other.
When I refinable or scroll one graph, the other is to repeat these changes.

I tried to do it in two different charts, Chart try through one but with two axes Y, does not come out.
What to do?

Ivan_kol wrote at 2013-07-14 08:27:

So, I was able to bring several mutually dependent areas.
<oxy:Plot Grid.Row="1" Model="{Binding ModelPower}" >
            <oxy:Plot.Axes>
                <oxy:LinearAxis Position="Left" Title="Power" StartPosition="0.5" EndPosition="1" Key="Power"/>
                <oxy:LinearAxis Position="Left" Title="Price" StartPosition="0" EndPosition="0.5" Key="Price"/>
                <oxy:DateTimeAxis Position="Bottom" EndPosition="1" StartPosition="0" StringFormat="hh:mm:ss.fff" IntervalType="Seconds"/>
            </oxy:Plot.Axes>
            <oxy:Plot.Series>
                <oxy:LineSeries ItemsSource="{Binding DataCollection}" MarkerType="Circle" Color="Blue" YAxisKey="Power" DataFieldX="DateTime" DataFieldY="APower"/>
                <oxy:LineSeries ItemsSource="{Binding DataCollection}" MarkerType="Circle" Color="Green" YAxisKey="Power" DataFieldX="DateTime" DataFieldY="BPower"/>

                <oxy:LineSeries ItemsSource="{Binding DataCollection}" MarkerType="Circle" Color="Blue" YAxisKey="Price" DataFieldX="DateTime" DataFieldY="BestA"/>
                <oxy:LineSeries ItemsSource="{Binding DataCollection}" MarkerType="Circle" Color="Green" YAxisKey="Price" DataFieldX="DateTime" DataFieldY="BestB"/>
            </oxy:Plot.Series>
        </oxy:Plot>

_Noctis_ wrote at 2013-11-05 14:32:

Did you have any success with this?

Ivan_kol wrote at 2013-11-06 01:21:

The above code is written as I did.

ivl64 wrote at 2013-12-10 08:37:

Thank You, Ivan_kol

Please, add this sample to example library.
CodePlex

First and foremost, sorry to ressurect and old thread. But I am attempting to do the same in C# with WPF. However, they "key" and "YAxisKey" property is not available. How would one proceed to do this with todays version?


Best regards,

Henrik