Pre loader

Get number of 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

To give a user some control over the number of gridlines of a DateTimeAxis, I gave the user control over the “MaxAutoTicks”. Works well, except that not all possible MaxAutoTicks settings have an effect on the number of shown major gridlines.
Is there a way to get the number of gridlines ( or the delta ) actually being drawn on the chart? I want to filter out all “MaxAutoTicks” values that have no effect on the amount of grid lines drawn.

I thought about using the DeltaCalculator,with different MaxAutoTicks, to calculate the delta and use that to determine which MaxAutoTicks have an effect on the number of gridlines drawn. Unfortunate I did not see a way to do this without the need to override the DateTimeAxis class to get public access( or a binding) to GetDeltaCalculator.

  • You must to post comments
0
0

Yes, I am also aware of the provider and deltacalculator. I tried to avoid this because the default date DeltaCalculator seems is good (enough). I didn’t want to reinvent the wheel that does almost the same thing as the date DeltaCalculator.

Currently I have an up/down ticker to set the “MaxTicks” so the user the some control over the delta, but many of the possible values have no effect. All I need is a way to figure out which of the possible MaxTicks value would have an effect on the calculate delta for a date axis. I thought about calling the DateDeltaCalculator myself, but the implementation does not seem to be publicly accessible.

  • Andrew Burnett-Thompson
    Could you simply inherit our DeltaCalculator and notify the ViewModel or your code what the calculated values are? Would this solve the problem? I just noticed you can’t because DeltaCalculator is internal. If we made it public so you could instantiate one and get the calculated values out, would this help?
  • _ _
    Yes, I think that would solve my problem. That probably means I have to upgrade to SciChart v4. I have to look into that. Requires some work on my side with the new MVVM interface and the RenderableSeries being deprecated.
  • _ _
    For now this is no longer necessary. It has unwanted side effects for the user. Thanks anyway.
  • _ _
    For some reason I was completely focussed on the DeltaProvider. It seems i could have used the TickProvider to get the actual number and the exact positions of the ticks, but it’s no longer necessary.
  • You must to post comments
0
0

Hi Steffam,

It sounds like you’re aware of DeltaCalculator and MaxAutoTicks, but are you aware of our TickProvider / DeltaCalculator API documentation?

There is a walkthrough there on creating your own to have full control over the axis tick and gridlines.

Does that help?

Best regards,
Andrew

  • You must to post comments
Showing 2 results
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