ibrahimsaputra / achartengine

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

max size of Legend is fixed in 15? #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, thanks for sharing this library to android world, 
I have one problem when use pie chart today.
In the source code of AbstractChart line 15 in drawLegend()
I saw , currentY += 15;

this is not right cause I will set the font size large than 15px in high 
resolution device, if I do so, for example set to 32px, the legend text will 
overlap each other.

I think the increase of currentY should depends on legend text size not 15, 
thanks.

/Dennis

Original issue reported on code.google.com by attic...@gmail.com on 18 Jan 2011 at 4:27

GoogleCodeExporter commented 9 years ago
Fixed in svn r122.

Original comment by dandrome...@gmail.com on 19 Jan 2011 at 11:37

GoogleCodeExporter commented 9 years ago
Hi, 
I found XYChart has same issue on drawing Labels and X,Y Titles. 
Following is my feedback to fix the issue in HORIZONTAL mode XYChart.java. (I 
think VERTICAL has some other bug and I didn't use this mode, so I didn't try 
how to fix this size issue in VERTICAL mode).

File : XYChart.java

at line 265,266, i change to:
          drawText(canvas, mRenderer.getXTitle(), x + left/2 + (width/2), bottom + 10 + mRenderer.getLabelsTextSize()+(mRenderer.getAxisTitleTextSize()/2), paint, 0);
          drawText(canvas, mRenderer.getYTitle(), x + 10 + (mRenderer.getAxisTitleTextSize()/2), y + top + (bottom / 2), paint, -90);

at line 421
          drawText(canvas, getLabel(label), xLabel, bottom + mRenderer.getLabelsTextSize(), paint, mRenderer.getXLabelsAngle());
/Dennis

Original comment by attic...@gmail.com on 20 Jan 2011 at 2:37