2

i'm wrapping this library so that it can be used with a platform called Basic4Android, so far everything works as expected, except that i'm having an issue setting the graphs background color when using two Y axis, has anyone seen this issue or is it just me?

here is my relevant code, it is the function i call to set the background color;

        public void SetBackGroundColor(BA ba, int color){
        graphview1.getViewport().setBackgroundColor(color);
    }

I have other functions just like this one, and they all work great, except my SetBackGroundColor function when i'm using two Y axis.

I get this error :

LogCat connected to: B4A-Bridge: LGE LGLS990 java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference at com.jjoe64.graphview.GridLabelRenderer.getLabelVerticalSecondScaleWidth(GridLabelRenderer.java:1296) at com.jjoe64.graphview.GraphView.getGraphContentWidth(GraphView.java:404) at com.jjoe64.graphview.Viewport.drawFirst(Viewport.java:883) at com.jjoe64.graphview.GraphView.onDraw(GraphView.java:295) at android.view.View.draw(View.java:15171) at android.view.View.updateDisplayListIfDirty(View.java:14096) at android.view.View.getDisplayList(View.java:14119) at android.view.View.draw(View.java:14895) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3199) at android.view.View.updateDisplayListIfDirty(View.java:14091) at android.view.View.getDisplayList(View.java:14119) at android.view.View.draw(View.java:14895) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3199) at android.view.View.draw(View.java:15174) at android.widget.FrameLayout.draw(FrameLayout.java:592) at android.view.View.updateDisplayListIfDirty(View.java:14096) at android.view.View.getDisplayList(View.java:14119) at android.view.View.draw(View.java:14895) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3199) at android.view.View.updateDisplayListIfDirty(View.java:14091) at android.view.View.getDisplayList(View.java:14119) at android.view.View.draw(View.java:14895) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3199) at android.view.View.draw(View.java:15174) at android.widget.FrameLayout.draw(FrameLayout.java:592) at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2695) at android.view.View.updateDisplayListIfDirty(View.java:14096) at android.view.View.getDisplayList(View.java:14119) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:266) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:272) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:311) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2531) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2367) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1998) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1078) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5875) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:550) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5299) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) ~e: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

From what i understand this error it is telling me that i'm trying to set a color to a null reference, but it doesn't make any sense since all the other functions work. If I comment out that function then everything works great, and If I remove the second Y Axis the SetBackGroundColor function works great. So in conclusion I think it is an issue with the library, but i'm not 100% sure, i was hoping someone could help me shed some light on this issue.

Thanks,

0 Answers0