Under review

Can't define Axes in Xaml

Phil Jollans 2 years ago in API • updated by Oystein Bjorke 2 years ago 3

I have added OxyPlot to my project using the nuget command

Install-Package OxyPlot.Wpf -Pre

In my first test I defined a PlotView in Xaml and the PlotModel in C# code.

Then I wanted to try configuring the Axes in Xaml, but that doesn't seem possible with the current version. PlotView does not have a property Axes.

I have downloaded the OxyPlot samples from GitHub. Some of the samples (for example AxesDemo) do define Axes in Xaml. What is going on?

Even if I could define the Axes in Xaml, would this be incompatible with data-binding to the Model property?

Is there some high level documentation of the structure of Plot, PlotView and Controller?


Under review

The `Axes` property can be found in the `<Plot>` control, not in `<PlotView>`. See the example:


Thanks, I had already figured this out from the GitHub "develop" branch. I have just now tried it out with build 1915 from NuGet and it also works.

I had also downloaded the "master" branch from GitHub. On this branch, the AxesDemo uses PlotView insteand of plot.

Has there been a change in the usage from PlotView to Plot?

I don't really get the difference between these objects.

By the way, I am really impressed with Oxyplot. Great work!


The `PlotView` component is now similar on all platforms, it contains only `Model` and `Controller` properties.

The `Plot` control let you define axes, series, annotations etc. and this should only be available in XAML-based platforms.