I am using an SCINumericAxis for my y-axis. I am setting the visibleRange to (Min = 28, Max = 76). I am leaving the minorsPerMajor to the default of 5. However when looking at my graph (attached) you can see that the major tick labels are actually every 6 minors, e.g. 30, 36, 42, etc. when they should be 30, 35, 40, etc for minorsPerMajor set to 5.
Please advise on how to fix this issue as my major tick labels should be every 5, not every 6.
- Brad Taber asked 4 years ago
- last edited 4 years ago
- Investigating further and trying different values for minorsPerMajor I realize now that the minor tick marks are not intended to indicate 31, 32, 33, etc as the values in between 30 and 36. Therefore I misunderstood how to control the spread for the major tick labels, I thought you could accomplish that with minorsPerMajor. So my real question then is: how do I control the frequency of the major tick labels. As in the example posted above, I would like it to be on the 5s, e.g. 30, 35, 40, etc as this is more understandable for my users similar to how the time axis major tick labels occurs on the 5s. Thank you for any thoughts on this.
- You must login to post comments
Hi, Brad.
What you need is to create your own TickProvider and in updateTicks method add to majorTicks only those values that you need. See the code:
import SciChart.Protected.SCITickProvider
class CustomNumericTickProvider: SCINumericTickProvider {
override func updateTicks(minorTicks: SCIDoubleValues!, majorTicks: SCIDoubleValues!) {
let start = self.axis.visibleRange.minAsDouble.rounded()
let end = self.axis.visibleRange.maxAsDouble.rounded()
let step: Double = 5
var current: Double = (start / step).rounded(.up) * step
while current <= end {
majorTicks.add(current)
current += step
}
}
}
For more details, take a look at https://www.scichart.com/documentation/ios/current/axis-ticks—tickprovider-and-deltacalculator-api.html#creating-your-own-tickprovider
- Andriy P answered 3 years ago
- last edited 3 years ago
- You must login to post comments
Please login first to submit.