I have a line chart and need to implement textAlign: left property for tickLabel on yAxis. I have found some way to do it on the forum, but it does not work in my case:
xAxis.setAxisTickLabelStyle(new AxisTickLabelStyle(Gravity.CENTER, Layout.Alignment.ALIGN_CENTER, 5, 0, 5, 0));
I get the error:
Alignment cannot be converted to int
But according documentation https://www.scichart.com/documentation/android/current/SciChart.Charting~com.scichart.charting.visuals.axes.AxisTickLabelStyle~_ctor.html AxisTickLabelStyle class get 5 int arguments. Can you help me please how to solve it!
- Alexander Kishchak asked 4 years ago
- last edited 4 years ago
- You must login to post comments
Hi Alexander,
The AxisTickLabelStyle constructor with six parameters was added recently and for now, I believe, it’s available only via our Maven repository with the latest nightly build. May I ask what version of SciChart do you use? Is it possible that you don’t use latest version from Maven? Can you try to get latest version from Maven repository ( for now the latest version is 4.2.0.4625 ) and let me know if it helps?
Best regards,
Yura
- Yura Khariton answered 4 years ago
-
Dear Yura! Thank you so much for the answer. We have 3rd SciChart version, we use it in React Native app. And at the moment we have some errors with IOS build. Therefore we can not update for the 4th version. Can you tell me please how can I implement label ‘s tick alignment on the 3rd version?
-
This would be very complicated task without modifying source code of the library. Basically you would need to reimplement part of axis renderer which is responsible for layout of axis tick labels, also it probably would require creating custom axis which exposes additional property and uses custom axis renderer.
-
Thank you so much for the advice. Could you be so kind to sent the link from the documentation how to implement it
-
The problem is that we don’t expose axis renderer code and default implementation isn’t public, because to change it you need to have deep knowledge of SciChart code + it’s partially written in C++ for the best performance, so C++ part can’t be overridden without accessing to the source code. The only way is to completely reimplement IAxisRenderer interface (https://www.scichart.com/documentation/android/current/webframe.html#SciChart.Charting~com.scichart.charting.visuals.axes.IAxisRenderer_members.html) and set it for axis (https://www.scichart.com/documentation/android/current/webframe.html#SciChart.Charting~com.scichart.charting.visuals.axes.AxisBase~setAxisRenderer.html), but because it’s so complicated and this section is performance critical we don’t have articles in documentation about how to do it, so to be honest it would be much easier to update to the latest version of SciChart which already has desired functionality
-
Ok! Thank you so much. I will try))
- You must login to post comments
Please login first to submit.