SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components


Hello SciChart-Team,
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.

Silvester Schneidt

  • You must to post comments

Hi Silvester

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.

  1. I didn’t see an annotation at zero line
  2. The gridlines do match the ticks… except for sometimes the max value here is 1px out

This was the only issue I saw:

enter image description here

… Oh I can see a very tiny deviation as you resize the window. Occasionally a tickline is 1px out.

TWo things to try

  1. Try setting UseLayoutRounding=True and SnapsToDevicePixels=True on every item in the visual tree (MainWindow, HistogramView, SciChartSurface).
  2. Try updating to the latest version of SciChart (6.5.1). We often minor visual fix bugs and issues and this may be one of them

Best regards

  • Silvester Schneidt
    Thanks Andrew for the quick reply. I will try your suggestions and give feedback if it worked
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.