Pre loader

XAxis MajorGridLines start date

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

Answered
1
0

Hi guys,

I am having trouble fixing up the XAxis labels and major gridlines.

My problem is, I have one data point per week – but the points are all on a Saturday, where the XAxis is showing me dates and major gridlines corresponding to Mondays.

Is there a way (without handling everything manually I hope!) where I can not only set the Major/Minor deltas, but also a date that the first Major Tick or Gridline starts on?

I have attached a screenshot to make my problem easier to understand; Although I have no interest in the 7th March, it is assigned a Major Gridline and a Label while my actual data point (5th March) is ignored, I would imagine, because it is not a Monday (first day of the week?).

If you’re wondering, yes the first point in this series is also a Saturday (26th June 2010) and the first Major Gridline appears on the 28th.

Images
  • You must to post comments
Best Answer
1
0

Update June 2014: TickProvider API

As an update for interested parties, it is now possible to configure the exact output of the Axis (configure which GridLines, TickMarks, TickLabels) by using the TickProvider API.

We have a similar answer on Configuring the Axis Ticks here.

Also a KB article on Advanced Tick Frequency Overriding using the TickProvider API which is new to SciChart v3.0.

Hope this helps

  • You must to post comments
0
0

Hi Miles,

Currently I’m afraid there’s no way to do this. There is an algorithm inside the DateTimeAxis which tries to choose sensible axis-ticks depending on the input date range. Believe it or not this was really tricky due to the wide ranges of dates that a user might use (Some sub-second, some on a year scale etc…). If you could come up with your own logic to generate axis ticks depending on an input range, then it might be possible to override the DateTimeAxis with your own implementation that outputs these values.

I believe the method to calculate ticks has the following signature:

// Where majorTicks, minorTicks are the date values of the major, minor grid lines as Ticks
long[] minorTicks = TickCalculator.GetMinors(DateRange inputVisibleRange);
long[] majorTicks = TickCalculator.GetMinors(DateRange inputVisibleRange);
  • 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