oxyplot
oxyplot copied to clipboard
Axis lables behind major grid line when axis zero-crossing
Steps to reproduce
-
Create a plot with one or more zero crossing axes (PositionAtZeroCrossing = true) The standard zero crossing examples in the example browser work fine
-
On all zero crossing axes, set the major grid lines to the following: MajorGridlineStyle = LineStyle.Solid, MajorGridlineThickness = 16, MinorGridlineColor = OxyColors.Red,
Basically we want big fat brightly coloured grid lines. It is important that they have a different color than the axis labels.
- Zoom in and out. Observe the way that when the grid lines overlap the axis labels, the grid lines are rendered on top and the axis labels can't be read.
Please note also, if these steps are followed for minor grid lines, the issue does not occur. The minor grid lines are behind the labels.
Platform: .NET version: 4.5
Expected behaviour
Tell us what should happen Labels should be rendered on top of any grid lines, so that they can be read by the user
Actual behaviour
The axis labels are obscured by the major grid lines. In most cases the lines are thin and it just looks bad, but if they are thick readability is affected.
In the attached screenshot minor grid lines in blue, also with width 16 are included to show the expected behaviour.
I forgot to mention I am using this in WPF. Now that I have looked into this further I think it is likely this issue only occurs in WPF. All z layer values of all rendered components are set to 0 so the render order is not reliably set by the renderer.
I agree, the labels should be drawn after all grid lines have been drawn. So rendering of axes should be done in two passes, first all lines for all axes, then all labels for all axes. I think this will look similar on all platforms, not just WPF!
Any update or workaround on this?