user1597721
user1597721

Reputation: 313

Display the gridlines for y axis of bar-chart in achartengine android

I'm using the achartengine in my android application, so i don't know how to show the gridlines for the y axis in the bar-chart. Does anyone know how to do with that?

Bar chart grid lines for y axis image

Thanks for any helps

Clark

Upvotes: 3

Views: 3132

Answers (2)

user2431172
user2431172

Reputation: 21

Answer given by Dan is correct.

You can enable by the below code.

 renderer.setShowGrid(true);
 renderer.setShowGridX(true);
 renderer.setShowGridY(true);`

You can disable the grid by below code

renderer.setShow(false);
renderer.setShowGridX(false);
renderer.setShowGridY(false);

Upvotes: 1

Dan D.
Dan D.

Reputation: 32391

You can enable all grid lines to be displayed by calling:

renderer.setShowGrid(true);

or you can enable them separately:

renderer.setShowGridX(true);
renderer.setShowGridY(true);

However, please note that grid lines are rendered along the chart labels.

Upvotes: 4

Related Questions