MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

How can i set fixed values on y-axis ????

Open jzafrilla opened this issue 12 years ago • 10 comments

Hi all! I would like to set fixed values (labels) on y-axis. For example, from 0 to 30 and display always this range. Can i do that? I'm looking into library code, but i have no idea how to do this.

Thanks in advance!

jzafrilla avatar Nov 06 '14 07:11 jzafrilla

Call chart.setYRange(0, 30, true);

PhilJay avatar Nov 06 '14 10:11 PhilJay

Thanks PhilJay!

jzafrilla avatar Nov 06 '14 10:11 jzafrilla

I can‘t find this method in the latest release?1.7.4.! How could it happen?

xf222zt avatar Nov 19 '14 11:11 xf222zt

Im not sure what you mean. The method is still there, you can see it in the latest commit.

public void setYRange(float minY, float maxY, boolean invalidate)

PhilJay avatar Nov 19 '14 11:11 PhilJay

I do not see this method public void setYRange(float minY, float maxY, boolean invalidate) in chart class

I am using library version mpandroidchartlibrary-2-1-4

ranj27 avatar Oct 29 '15 21:10 ranj27

I don't see it either

Utsav2 avatar Apr 16 '16 02:04 Utsav2

I too cannot see this function on an object of type LineChart.

tejkoorapati avatar Jun 02 '16 21:06 tejkoorapati

For linechart you set it to axises, like this (left and/or right):

lineChart.getAxisLeft().setAxisMaxValue(100f);
lineChart.getAxisLeft().setAxisMinValue(0f);

alaurila avatar Jun 10 '16 06:06 alaurila

I used this:

YAxis y = mChart.getAxisLeft(); y.setLabelCount(5); y.setAxisMaxValue(100); y.setAxisMinValue(20);

So, will make this:

20 - 40 - 60 - 80 - 100

carlosughini avatar Nov 14 '17 17:11 carlosughini

i am currently using seek bars to change the values on the radar chart but the axis keeps resizing, how do i make it that it just has a standard range of 0 - 100 in intervals of 10.

johnandersonUJ avatar Oct 01 '20 18:10 johnandersonUJ