Reputation: 431
I create a OxyPlot
plot with 20 series. Each series
represents a channel. The origin is now at bottom left corner.
See picture bellow:
I would like to have them order from top to bottom. How to set OxyPlot origin in top left corner?(See picture bellow)
Upvotes: 2
Views: 1040
Reputation: 431
I recently found a within Oxyplot
Axis
configuration propriety StartPosition
that is supposed to get
and set
the start position of the axis
.
However I did not figure it out if this would change the orientation of the origin point.
I came up with a different solution, I decided to plot them reversely and use a CategoryAxis
for the left axis and set the labels in a descending order.
plotModel.Axes.Add(new LinearAxis
{
Position = AxisPosition.Bottom,
MajorTickSize = 0,
MinorTickSize = 0
});
plotModel.Axes.Add(new CategoryAxis
{
Position = AxisPosition.Left,
Title = MyTitle,
MajorTickSize = 0,
MinorTickSize = 0,
LabelField = "LabelChannels",
Labels =
{ "20",
"19",
...
"3",
"2",
"1",
}
});
It would be nice though to know if there is any other way, much simpler than what I did.
Upvotes: 0
Reputation: 8543
I know this is old, but you just had to set the Axis StartPosition to 1 and the EndPosition to 0
CategoryAxis myAxis = new CategoryAxis();
myAxis.StartPosition = 1;
myAxis.EndPosition = 0;
Upvotes: 2