When setting
renderer.setXLabels(0);
and adding
renderer.addTextLabel(123, "abc"); // or addXTextLabel in r145
the chart does not draw the vertical grid. I can't think of a case where, when
using custom labels in the currently implemented way, you would NOT want to
have the vertical grid, if the grid is enabled at all.
So considering this as a bug, you can easily fix this by substituting the code
in XYChart.java (lines 460ff) with:
if (showLabels) {
for (Double location : xTextLabelLocations) {
paint.setColor(mRenderer.getLabelsColor());
float xLabel = (float) (left + xPixelsPerUnit * (location.doubleValue() - minX));
canvas.drawLine(xLabel, bottom, xLabel, bottom + 4, paint);
drawText(canvas, mRenderer.getXTextLabel(location), xLabel, bottom + mRenderer.getLabelsTextSize(), paint, mRenderer
.getXLabelsAngle());
if (showGrid) {
paint.setColor(mRenderer.getGridColor());
canvas.drawLine(xLabel, bottom, xLabel, top, paint);
}
}
}
I did this locally, but I think someone else asked for it in a discussion
(sorry, don't have the link anymore).
Best regards and keep up the great work !
Ben
Original issue reported on code.google.com by benfwi...@gmail.com on 29 Apr 2011 at 11:30
Original issue reported on code.google.com by
benfwi...@gmail.com
on 29 Apr 2011 at 11:30