we had the requirement to show the zero line when there are negative values in the chart.
We noticed the following things, especially in connection with the main grid lines.
There are some side effects at certain sizes of the window:
When the gridlines are on(see screenshot 1):
1. Grid line and tick are not on the same level (Only for certain sizes)
2. The grid line and horizontal annotation line (green) are not aligned either (Only at certain sizes)
3. The axis line (defined via BorderThickness) is also not aligned with the grid line (regardless of the size of the control).And the bottom tick is never aligned with the major grid line
If the major grid lines are switched off, the zero annotation line is not aligned to the ticks for certain sizes of the control (see screenshot 2)
It looks like different algorithms were used to calculate the line position of the ticks, grid lines and line annotations.
The problem was detected on the monitor with 100% scaling. On a 4K monitor with scaling > 100%, the problem became even more apparent
Do you have any suggestion how to solve the problem?
I’ve attached a modified example project in which the behavior can be reproduced.
This looks like a 1-pixel rounding error. The ticks are drawn using a different technology (our bitmap/GPU rasteriser) to the annotations (WPF) so they may not match 100% in appearance. The gridlines & ticks should line up though.
I tried out your sample on a 4K monitor. Looks close to perfect to me.
This was the only issue I saw:
… Oh I can see a very tiny deviation as you resize the window. Occasionally a tickline is 1px out.
TWo things to try
Please login first to submit.