whitespace COMPANY whitespace SERVICES whitespace PRODUCTS whitespace PURCHASE whitespace SUPPORT whitespace CONTACTS whitespace Home whitespace Contact Us whitespace Site Map whitespace
whitespace
SUPPORT
whitespace
FORUM
whitespace
FAQS
whitespace
SUBSCRIPTION
whitespace
REQUEST ON-LINE
whitespace
whitespace

Technical Support Forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
ahsteele  
#1 Posted : Wednesday, March 24, 2010 8:34:04 PM(UTC)
ahsteele
Rank: Newbie

Groups: Registered
Joined: 3/14/2010(UTC)
Posts: 8
Location: Colorado, US

When I remove a ChartSeries from a ChartView, I am getting a NullPointerException.

I am removing the ChartSeries like this:
chartView.getSeries().remove(1);

Is there another to remove without causing this error? Or is there a way to disable a ChartSeries, so that it is not visible on the chart?

Here is the stack that I am receiving...

03-24 16:19:17.715: ERROR/AndroidRuntime(754): Uncaught handler: thread main exiting due to uncaught exception
03-24 16:19:17.841: ERROR/AndroidRuntime(754): java.lang.NullPointerException
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at com.artfulbits.aiCharts.Types.ChartLineType.draw(ChartLineType.java:86)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at com.artfulbits.aiCharts.Base.ChartArea.draw(ChartArea.java:432)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at com.artfulbits.aiCharts.Base.ChartEngine.draw(ChartEngine.java:469)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at com.artfulbits.aiCharts.ChartView.onDraw(ChartView.java:514)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.View.draw(View.java:6535)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewGroup.drawChild(ViewGroup.java:1531)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewGroup.drawChild(ViewGroup.java:1529)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.View.draw(View.java:6538)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewGroup.drawChild(ViewGroup.java:1531)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.View.draw(View.java:6538)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.widget.FrameLayout.draw(FrameLayout.java:352)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewGroup.drawChild(ViewGroup.java:1531)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.View.draw(View.java:6538)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.widget.FrameLayout.draw(FrameLayout.java:352)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewRoot.draw(ViewRoot.java:1349)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewRoot.performTraversals(ViewRoot.java:1114)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.os.Handler.dispatchMessage(Handler.java:99)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.os.Looper.loop(Looper.java:123)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at android.app.ActivityThread.main(ActivityThread.java:4363)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at java.lang.reflect.Method.invokeNative(Native Method)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at java.lang.reflect.Method.invoke(Method.java:521)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
03-24 16:19:17.841: ERROR/AndroidRuntime(754): at dalvik.system.NativeStart.main(Native Method)
ahsteele  
#2 Posted : Thursday, March 25, 2010 9:12:08 AM(UTC)
ahsteele
Rank: Newbie

Groups: Registered
Joined: 3/14/2010(UTC)
Posts: 8
Location: Colorado, US

I implemented a workaround for this by copying all ChartPoints associated with the ChartSeries that I want to disappear over to a list. When the user selects to display the ChartSeries again, I am copying the ChartPoints back over to the ChartSeries ChartPointCollection. This in essence makes a line disappear/reappear from a chart. It's a bit of a hack, but preserves the points and ensures that the ChartSeries will have the same color from the palette as it originally did.

Baydalka Volodymyr  
#3 Posted : Thursday, March 25, 2010 8:16:58 PM(UTC)
Baydalka Volodymyr
Rank: Member

Groups: Registered
Joined: 7/28/2009(UTC)
Posts: 447
Man

Hi,

Thank you for bug report. Try to call ChartArea.refresh() method when you remove series

Best regards,
Volodymyr Baydalka
Andriod development and support team
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Company | Services | Practices | Technologies | Career | Contacts | Privacy
© 2005-2017 ArtfulBits. All rights reserved.