Fahad Abid Janjua
Fahad Abid Janjua

Reputation: 1024

Margin Between X-Axis Title and X-Axis Labels in AChartEngine

Iam using AChartEngine Stacked Bar Chart. Can i add spacing between X-Axis Title and X-Axis Labels. They are too closed to each other.

set Bottom Margin will only add spacing between X-Axis Title and Legend.

Upvotes: 8

Views: 6464

Answers (3)

John Ding
John Ding

Reputation: 1350

use this method: setXLabelsPadding

Upvotes: 1

Narendrasinh Dodiya
Narendrasinh Dodiya

Reputation: 325

A quick patch which solved my problem, modify your X-Axis Title and prefix it with new lines, e.g

    renderer.setXTitle("\n\n\n Months");

Upvotes: 14

Dan D.
Dan D.

Reputation: 32391

Use the setMargins() method. You can set the margins between the chart and the margins of the screen.

renderer.setMargins(new int[] {30, 100, 10, 0);

The order of the values in the parameter array is: top, left, bottom, right. So, you will need to increase the left value.

Upvotes: 12

Related Questions