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

0
0

When the major grid lines are drawn with a delta equal to or greater than a month, the minor grid lines are no longer drawn between the major gridlines (with a DateTimeAxis).

I discovered this behavior in my own project, so I tried some demo projects of v3.6 and v4. In both versions the minor grid lines are no longer drawn between the major gridlines when the delta of the major grid line is equal to or greater than a month.

I added an screenshot of how the “Using Thememanager” demo of SciChart v4 draws the major and (misaligned) minor grid lines.

Is this a feature I’m not aware of or is this a bug?

Images
  • You must to post comments
0
0

Hi Steffan,

This occurs because the ThemeManager example is using a CategoryDateTimeAxis, and the CategoryDateTimeAxis uses indices to data to place gridlines, labels and coordinates on the chart.

For example:

Given major gridlines falling on months January, February, March, there are 31, 28 and 31 days in these months.

Minor Delta always needs to be some ‘sane’ division of major, so next, SciChart chooses weeks (7-days). This means that minor gridlines fall on the 7th, 14th, 21st, 28th of January etc… Subsequent gridlines are drawn at week intervals so after 28th Jan is 4th Feb, 11th Feb etc.. These gridlines appear to be uneven (as they are spaced at week boundaries).

What you can do is override our tick generation with the TickProvider API. If you choose one of our TickProviders as a basis, you can inherit it and keep the major divisions but override just the minors. Let me know if you need any assistance with this.

Best regards,
Andrew

  • Steffan Woltjer
    Hi Andrew, the axis is not a CategoryDataTime Axis, it’s a DateTimeAxis, but I guess the same “issue” applies to that type of axis. I’ll try to use the TickProvider to change the behavior.
  • Andrew
    Thanks Steffan, we have some good examples on how to use this API in our documentation, and if you have any questions, please feel free to ask!
  • Steffan Woltjer
    I solved it by overriding GetMinorTicks which returns my custom values when major ticks of 1,3 or 6 months are shown, otherwise it just returns base.GetMinorTicks(). Thanks!
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.