gorteganesh / achartengine

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

Size of the graphical view is wrong when there is another view on top of it #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create any graph with AChartEngine
2. Use another view on top of this graph ( I had a sliding drawer, from 
miscWidget on GoogleCode )
3. Move the sliding drawer

What is the expected output? What do you see instead?
The size of the graph was not the correct one.

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

What version of the product binary library are you using?
Hum.. The last one ??

Please provide any additional information below.

Actually, I kind of fix it :
Changing graphicalView from :
 @Override
  protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    canvas.getClipBounds(mRect);
    int top = mRect.top;
    int left = mRect.left;
    int width = mRect.width();
    int height = mRect.height();
    mChart.draw(canvas, left, top, width, height);
  }

To :
 @Override
  protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    canvas.getClipBounds(mRect);
    int top = mRect.top;
    int left = mRect.left;
    //int width = mRect.width();
    //int height = mRect.height();
    int width = canvas.getWidth();
    int height = canvas.getHeight();
    mChart.draw(canvas, left, top, width, height);
  }

Note that it implies that the full graph view will be drawned every time, 
even if half of it is hidden. But I don't think it is such a big deal...

Original issue reported on code.google.com by emmanuel...@gmail.com on 16 May 2010 at 3:12

GoogleCodeExporter commented 9 years ago
Not sure I understand the fix you provided.
Your fix makes the chart take the entire canvas height, but in the canvas there 
may be other views needing space.

Dan

Original comment by dandrome...@gmail.com on 21 Jun 2010 at 6:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This is more of a help than Issue: I want to show the graph as a ImageView on 
my layout which have some text above and some text below the ImageView. Can 
this be done by any chance? 

Original comment by NidhiAga...@gmail.com on 27 Jul 2010 at 10:02

GoogleCodeExporter commented 9 years ago
@nidhi

check XYChartBuilder on how to place a chart into a custom Layout. 
XYChartBuilder creates the view you can see at http://www.achartengine.org/

Original comment by marc.log...@gmail.com on 28 Jul 2010 at 9:09

GoogleCodeExporter commented 9 years ago

Original comment by dandrome...@gmail.com on 16 Nov 2010 at 5:17