SolarTheCenter / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

ClassCastException: org.achartengine.renderer.SimpleSeriesRenderer cannot be cast to org.achartengine.renderer.XYSeriesRenderer #383

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I tried to switch to 1.2.0 due to the problem with negative bar values not 
displayed
Everywhere i used XYSeriesRenderer i get the error
ClassCastException: org.achartengine.renderer.SimpleSeriesRenderer cannot be 
cast to org.achartengine.renderer.XYSeriesRenderer

Also your example crash when updating lib references with some charts (ie sales 
stacked bar chart)

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

Please provide a source code snippet that we can use to replicate the
issue.

What version of the product binary library are you using?
1.2.0

Please provide any additional information below.

Original issue reported on code.google.com by stef.ba...@gmail.com on 5 Jan 2014 at 10:54

GoogleCodeExporter commented 9 years ago
I think the issue you have is that you are building SimpleSeriesRenderer and 
you should build XYSeriesRenderer objects.

If I am wrong then please post some source code showing the problem.

Original comment by 4viewsoft@gmail.com on 7 Jan 2014 at 10:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Maybe object hierarchy changed..i don't know
If you wanna try just use the achartenginedemo and replace the lib
Opening sales stacked bar chart willl crash

Original comment by stef.ba...@gmail.com on 9 Jan 2014 at 8:30

GoogleCodeExporter commented 9 years ago
I had the same problem. 
The error occured in line 247 XYChart.java (trunk):
XYSeriesRenderer seriesRenderer = (XYSeriesRenderer) 
mRenderer.getSeriesRendererAt(i);

In Version 1.1 it was:
SimpleSeriesRenderer seriesRenderer = mRenderer.getSeriesRendererAt(i);

So if you use a XYSeriesRenderer it should work...

Original comment by sauberma...@gmail.com on 30 May 2014 at 12:38