Reputation: 1024
In AChartEngine Bar Chart, is it possible that the bars are drawn over grid lines? How to do that? Currently grid lines are drawn over bars which make it a bit awkward.
Sample Image is attached below.
Upvotes: 7
Views: 1081
Reputation: 5254
Even tough this is not a perfect answer, it is possible to achieve that behaviour, by making some changes to the method 'draw' of the class XYChart.
I am not sure this will not cause any other issues, but for me it has been working. Basically the idea consists in drawing the labels and grid before drawing the chart line.
I moved all the code starting and ending in:
boolean showLabels = mRenderer.isShowLabels() && hasValues;
...
drawText(canvas, mRenderer.getChartTitle(), x + size, top + height / 2, paint, 0);
}
}
to before this line:
boolean hasValues = false;
Also, I commented the && hasValues
part.
Note that this is definitely not reliable code, just a slight hack.
Upvotes: 1
Reputation: 21
Up to AChartEngine 1.2.0 it is not possible. You cannot bring the grid lines over a chart.
Upvotes: 0
Reputation: 32391
You cannot change which one is drawn first and which one next.
However, you can change the color of the grid lines. For instance, you can set a color that is a bit transparent, such as it doesn't really look like it is drawn above the bars.
Upvotes: 4