Pre loader

Minor gridlines not drawn between major gridlines

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

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

  • _ _
    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 Burnett-Thompson
    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!
  • _ _
    • _ _
    • 8 years ago
    • 1
    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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies