0

It is necessary to make a range according to the selected mode, but scichart draws the wrong interval. For example, I want to set the interval to 1 day. Using SciChart.

settings x axis

 val xAxis = sciChartBuilder.newCategoryDateAxis()
            .withBarTimeFrame(60.0*60.0*24.0) //seconds in day
            .withDrawMinorGridLines(false)
            .withGrowBy(0.0, 0.1)
            .build()

result result

about how it should look about how it should look

Zakhar Rodionov
  • 1,398
  • 16
  • 18

1 Answers1

0

If you want to alter spacing between major axis ticks then you probably need to change MajorDelta value.

As I see you use CategoryDateAxis so you should be aware that this axis type is index based and it operates with indices instead of Dates. This means that if you have data where xData in unevenly spaced (e.g. distance in time between points is different ) then with type of xAxis on chart you'll see the same distance between points.

This also means that you'll need to specify MajorDelta as index interval and you can't specify time interval out of the box. To provide desired output you'll need to calculate how many data points lies within desired time span. For example if your data contains points with interval 15 min then to draw major tick every 4 hours like on screenshot you'll need to set MajorDelta = 16 ( 15min * 16 = 4 hours ) but as I said it depends on data set which you're trying to display.

Yura Khariton
  • 484
  • 2
  • 6