Pre loader

Converting CategoryDateAxis Data to/from Pixels NPE

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

0
0

Hi,
Im tried to convert date into xAxis using this tutorial

https://www.scichart.com/documentation/android/current/webframe.html#Axis%20APIs%20-%20Convert%20Pixel%20to%20Data%20Coordinates.html

but i got this error

Java.lang.RuntimeException: Unable to start activity ComponentInfo{}: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object com.scichart.data.numerics.math.IMath.fromDouble(double)' on a null object reference

here my code

https://gist.github.com/ngiyus/4590c009261a28dba2c8b10e123a97f3

Version
4.2.0.4557
  • You must to post comments
0
0

Hi there,

I took a look on your code. Unfortunately I couldn’t create a working project from your code, but I think I was able identify cause of issue. It look like this exception occurs because you call transformDataToIndex() immediately after creation of axis and it wasn’t rendered by chart yet ( by default rendering occurs on separate thread and executed asynchronously when something changes in chart ). Because of this label provider isn’t located data series which should be used to map dates to indices and math required for conversion.

May I ask why do you need to call this method right after creation? Anyway I’m going to create a task to investigate how we can fix this, and as workaround I would suggest to delay calling this method untill chart will be rendered for the first time or just get index of desired Date from dataSeries directly ( or from priceSeries if they available )

Best regards,
Yura

  • Yura Khariton
    I want to notify you that this issue should be fixed in our internal build and fix will be available with our next nightly build in our Maven repository
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies