ibrahimsaputra / achartengine

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

Chart shrinks when it scrolls out of screen #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I have a Scrollview with some other views inside and a chart at the top.
When I scroll down and the chart gets out of screen at the top, it suddenly 
shrinks, because it wants to fit in the remaining space.

I looked at the code and changed the following thing to fix it for me:
In GraphicalView.java, Method onDraw at the beginning

    canvas.getClipBounds(mRect);
    int top = mRect.top;
    int left = mRect.left;
    int width = mRect.width();
    int height = mRect.height();

to

    int top = 0;
    int left = 0;
    int width = getMeasuredWidth();
    int height = getMeasuredHeight();

Now the chart just scrolls out as expected.

Cheers,
Harald

Original issue reported on code.google.com by harald.k...@gmail.com on 18 Dec 2010 at 7:11

GoogleCodeExporter commented 9 years ago
Please provide a demo program that I can use to replicate the issues you have.

Original comment by dandrome...@gmail.com on 3 Feb 2011 at 11:03

GoogleCodeExporter commented 9 years ago
Thanks!!!!!!!!!!!!!!!!!!!!!

Original comment by sepet...@gmail.com on 14 Feb 2011 at 8:32

GoogleCodeExporter commented 9 years ago
What should this comment #2 mean? Do you have any code that replicates this 
issue?

Original comment by dandrome...@gmail.com on 14 Feb 2011 at 10:04

GoogleCodeExporter commented 9 years ago

Original comment by dandrome...@gmail.com on 30 Mar 2011 at 7:59

GoogleCodeExporter commented 9 years ago
See this as it may help
http://groups.google.com/group/achartengine/browse_thread/thread/8fa048ad9f1f9b8
9

Original comment by dandrome...@gmail.com on 30 Apr 2011 at 6:24

GoogleCodeExporter commented 9 years ago
I had this bug as well, and then turned it into a feature.

I had my chart on the bottom of a scrollview (width="fill_parent"), but the 
text before the chart was fixed and not very long, so on smaller screens the 
chart only had about half of the space it wanted to take.

So when the user opened the screen, the chart was slightly squeezed, but all 
info was visible - with the option to maximise the chart by scrolling. See the 
app "handy elephant - personal crm" (available on the android market) for an 
example. But beware, the current beta crashes at times.

No matter if you find a solution for this, PLEASE give us an option for this 
auto-sizing, it's awesome :)

Original comment by benfwi...@gmail.com on 1 May 2011 at 6:06

GoogleCodeExporter commented 9 years ago
So can anyone please provide some source code that replicates this issue?

Original comment by dandrome...@gmail.com on 19 May 2011 at 7:23

GoogleCodeExporter commented 9 years ago
Hey,

I have this problem too. When adding listview items to a listview, and putting 
charts inside the items, it scales when scrolling.

I have attached a sample project that displays the error.

achartengine 0.6 jar is used.

Original comment by kasperho...@gmail.com on 18 Jun 2011 at 5:20

Attachments:

GoogleCodeExporter commented 9 years ago
I tested the zoomcharttest on my device (Nexus One with Android 2.3.4) and it 
doesn't seem to scale at all.
Does anyone have a demo that replicates the scroll bar issue?

Original comment by dandrome...@gmail.com on 30 Jun 2011 at 4:38

GoogleCodeExporter commented 9 years ago
Reducing priority, as nobody seems to provide a use case that replicates this 
issue.

Original comment by dandrome...@gmail.com on 1 Jul 2011 at 7:13

GoogleCodeExporter commented 9 years ago
Hi, Dan. I had the same issue so here you're an example. I'm using Samsung 
Galaxy Tab with Android 2.2.1 (zoomcharttest didn't scale to me either). 

Original comment by juliale...@gmail.com on 18 Jul 2011 at 1:29

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Harald, I have the problem with the shrinked chart, too.
But I don't understand how you fixed it.
How do I change the GraphicalView.java?
I do not even know how to find it .. 

MfG
Phil.

Original comment by philipp....@gmail.com on 27 Jul 2011 at 9:59

GoogleCodeExporter commented 9 years ago
Finally fixed this issue in SVN rev. r302.
Call renderer.setInScroll(true) in order to get the non-shrink behavior or 
don't do anything if you want the shrinking behavior.

Original comment by dandrome...@gmail.com on 27 Jul 2011 at 3:43

GoogleCodeExporter commented 9 years ago
thank, got the solve.
renderer.setInScroll(true); // for inscoroll

renderer.setClickEnabled(true);
renderer.setSelectableBuffer(100);  // for fixed chart

Original comment by tanmoyj...@grmtech.com on 26 Sep 2011 at 11:36

GoogleCodeExporter commented 9 years ago
can anyone provide further informations about the solution???? Thank you

Original comment by stylia...@gmail.com on 30 Oct 2013 at 9:51