SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
What’s the new (Swift) signature for V2’s updateDataContext(withContext label: SCIDefaultTickLabel!, data dataValue: SCIGenericType, style: SCITextFormattingStyle!) -> SCITickLabelProtocol!
? Obviously the SciGenericType is different.
My searches aren’t pulling up anything except hits on the V2 documentation, and all of those now 404.
I’m using that call to put gesture recognizers on some tick labels. I want those gesture recognizers to be different than the one I’m putting on the entire chart. And I need to update the locations every time theX axis changes. An alternate way to achieve this would also be welcome.
Hi, there.
If I understand your issue correctly, you can get major ticks coordinates, like this:
1) If You use SCINumericAxis, subclass SCINumericLabelProvider and override “updateTickLabels:majorTicks:” method, like this
import SciChart.Protected.SCILabelProviderBase
class CustomLabelProvider: SCINumericLabelProvider {
override func updateTickLabels(_ formattedTickLabels: NSMutableArray!, majorTicks: SCIDoubleValues!) {
super.updateTickLabels(formattedTickLabels, majorTicks: majorTicks)
print("formattedTickLabels: \(formattedTickLabels)")
print("majorTicks: \(majorTicks)")
}
}
2) create an instance and set it to xAxis.labelProvider:
let xAxis = SCINumericAxis()
xAxis.labelProvider = CustomLabelProvider()
You will get your major ticks on each update, see the screenshot.
Let us know if that helps.
Please login first to submit.