SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components


Im tried to convert date into xAxis using this tutorial

but i got this error

Java.lang.RuntimeException: Unable to start activity ComponentInfo{}: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object' on a null object reference

here my code

  • You must to post comments

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 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.