Search code examples
androidchartsachartengine

AChartEngine : Align Y-Axis Labels on right side of Axis itself


i am using aChartEngine for android. i have a problem with the y-axis, when the values reaches 10000 or more, the left digit is disappeared (Check the photo) in the photo the values are 7000-11500 but the values appearing above 10000 are 0000,0500, . . . etc

I would like to set the y-axis labels on the right side of the axis or something like that

can anyone help ?

knowing that i used

renderer.setYLabelsAlign(Align.RIGHT);

Y-Axis Labels


Solution

  • You can tweak the margins of your chart:

    renderer.setMargins(margins);
    

    where margins is an array of [top, left, bottom, right]

    If you want to set the alignment on the right side of the grid, just set Align.LEFT, which means they are align on the left.