yunjianwu / achartengine

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

Moving chart causes crash #322

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Put the following code in an activity.
2. Drag the chart downwards (other directions might work too).

What is the expected output? What do you see instead?
A working chart. I see a crashing app! libc Fatal signal 11 (SIGSEGV) ...

Please provide a source code snippet that we can use to replicate the issue.
XYSeries xySeries = new XYSeries("Test");
xySeries.add(1, 1);
xySeries.add(2, 10);
xySeries.add(3, 100);
xySeries.add(5, 10);
xySeries.add(1371920863, 50);
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
dataset.addSeries(xySeries);
XYSeriesRenderer xySeriesRenderer = new XYSeriesRenderer();
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
renderer.addSeriesRenderer(xySeriesRenderer);
GraphicalView v = ChartFactory.getTimeChartView(this, dataset, renderer, null);
// xml with only a linear layout
LinearLayout l = (LinearLayout) findViewById(R.id.linearLayoutChart);
l.addView(v);

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

Please provide any additional information below.
It crashes on my Sony xperia go with android 4.1.2.
But on my htc desire running on 2.2.2 it works.

Original issue reported on code.google.com by john.vik...@gmail.com on 22 Jun 2013 at 5:29

GoogleCodeExporter commented 9 years ago
Hello John,

I have the same problem. Have you find how to fix it?

thanks

Original comment by roni...@gmail.com on 28 Jul 2013 at 11:45

GoogleCodeExporter commented 9 years ago
@up
No I haven't tried to fix it.

Original comment by john.vik...@gmail.com on 29 Jul 2013 at 2:58

GoogleCodeExporter commented 9 years ago
I had the same problem and I think it is solved if you add the line 
renderer.setZoomEnabled(true,true); I dont get the crash now

Original comment by PhedonRo...@gmail.com on 8 Aug 2013 at 3:58

GoogleCodeExporter commented 9 years ago
Nop, that did not solve the problem, for some reason it was working for a 
while, then crashed

Original comment by PhedonRo...@gmail.com on 9 Aug 2013 at 10:29

GoogleCodeExporter commented 9 years ago
I don't know if you have fixed this problem already, but I had a similair issue 
on my HOX.

When I used this code (and the few lines that followed, copied from 
SalesGrowthChart demo) i had the same issue:
XYSeriesRenderer xyRenderer = (XYSeriesRenderer) 
renderer.getSeriesRendererAt(0);
FillOutsideLine fill = new FillOutsideLine(FillOutsideLine.Type.BOUNDS_ABOVE);
fill.setColor(Color.GREEN);

It looks to me like it's an issue with the XYSeriesRenderer.

Original comment by tilburgs...@gmail.com on 22 Oct 2013 at 10:02

GoogleCodeExporter commented 9 years ago
Any logs you can share?

Original comment by dandrome...@gmail.com on 31 Oct 2013 at 8:25

GoogleCodeExporter commented 9 years ago
I'm afraid not. The only thing I got was the 11 sigsev. On my other phone the 
app just hung for a while then it continued.

Original comment by john.vik...@gmail.com on 31 Oct 2013 at 3:27

GoogleCodeExporter commented 9 years ago

Original comment by dandrome...@gmail.com on 25 Nov 2013 at 10:14

GoogleCodeExporter commented 9 years ago
I just hit the same problem. Whenever I pan a TimeChart down and up again, the 
activity stops with signal 11.
So I am a bit wondering, why the issue was set to "invalid".

Original comment by Edgar.Bo...@googlemail.com on 23 May 2014 at 1:23

GoogleCodeExporter commented 9 years ago
I investigated a bit more and could track down the problem to the following 
situation:
1. The problem only appears if GPU acceleration is enforced in the phones 
developer options.
2. The real cause of the problem is that the method calculateDrawPoints() in 
AbstractChart returns NaN-Values if p2y = p1Y and p2x = p1x.
I am not sure, when exactly this happens, but I think it has to do with very 
narrow points on the x-Axis.
It seems, that Android can deal with paths, where a lineTo(NaN,someValue) was 
added, if GPU acceleration is switched on, but reacts with a signal 11 if 
acceleration is switched on.
I did not exactly understand, what calculateDrawPoints is doing. So I am not 
sure, what the correct reaction would be, if the NaN-Values appear. 

Original comment by Edgar.Bo...@googlemail.com on 25 May 2014 at 8:01