Pre loader

How to calculate distance of points for CategoryDateTimeAxis

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


I am using the CategoryDateTimeAxis to fetch data in minute resolution for a few days and then append realtime data in one second resolution to it. Since the CategoryDateTimeAxis uses equidistance calculations I was wondering if it is possible to override that behaviour somehow? I.e. can I control the distance calculation somehow?

I am currently switching to CategoryDateTimeAxis because DiscontinuousDateTimeAxis provides to much of a performance hit for our use case.

  • You must to post comments

Hi Raphael

No, there’s no easy way to do this unfortunately. What you’d have to do is create a custom axis and custom coordinate calculator using our source code as a guideline. Each axis is a combination of AxisBase derived class, and CoordinateCalculatorBase derived class. So for example LogarithmicNumericAxis has LogarithmicCoordinateCalculator, and CategoryDateTimeAxis has CategoryCoordinateCalculator.

Each calculator does the transformations from pixel to data coordinates (and back) as well as simple operations such as pan, translate, zoom. These calculators are used in drawing as well as axis scaling.

There are no examples for this I’m afraid, as it’s not a standard feature in SciChart.

Another idea for you is to use the DiscontinuousDateTimeAxis but provide a custom calender that is lightweight and skips ranges. Take a look at our DiscontinuousDateTimeCalender implementation in code and see how we’ve done it. We don’t have a code example but one of our customers implemented their own calender and achieved a huge speedup in performance for this axis type, assuming simpler rules such as ‘only weekends ignored’

Best regards,

  • Raphael Neumann
    Number two proposal was actually what we used before. Our own calendar, were we set weekends to skip, specific ranges on days, and skipping specific days such as holidays. However it seemed that performance was decreased when using this approach. Whereas a default calendar or using CategoryDateTimeAxis actually had better performance. Our assumption lies in the fact that the DiscontinuousDateTimeAxis has to do alot of filter calls on the calendar, and when that calendar has many dates and ranges to skip, performance can be impacted negatively. Is this assumption true, if so, any tips on bettering performance on our side?
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.