setSpaceTop and setSpaceBottom not working
Hi Phil, first of all great job with v2! I updated everything and all is working fine.
I saw at the wiki these methods setSpaceTop¡ and setSpaceBottom but they seem to not change the space:
mChart.getAxisLeft().setSpaceTop(50f); mChart.getAxisLeft().setSpaceBottom(50f);
It should add 50% of the range as padding right?
Regards
Yes they should. Can you show me your chart setup?
mChart.getAxisLeft().setStartAtZero(false);
mChart.getAxisLeft().setGridColor(Color.LTGRAY & 0x70FFFFFF);
mChart.getAxisLeft().setGridLineWidth(0.5f);
mChart.getAxisLeft().setDrawAxisLine(false);
mChart.getAxisLeft().setValueFormatter(new ChartValueFormaterPrice());
mChart.getXAxis().setDrawAxisLine(false);
mChart.getAxisRight().setEnabled(false);
....
LineData data = ChartDataParser.getLineData(obj, range);
LineDataSet set1 = data.getDataSetByIndex(0);
set1.setLineWidth(2f);
set1.setDrawFilled(true);
set1.setCircleSize(0f);
mChart.setData(data);
mChart.getAxisLeft().setSpaceTop(50f);
mChart.getAxisLeft().setSpaceBottom(50f);
mChart.getAxisLeft().setLabelCount(4);
mChart.getLegend().setEnabled(false);
mChart.animateX(700);
I've changed the 50% value for others and nothing changes. Maybe it's because the range is small? like 0.2 - 0.3
#406
Hi Phil! U did a very nice job with this library! I have a question. If u dont set chart.getAxisLeft().setStartAtZero(false); than how can you use YAxis.setSpaceBottom() at LineChart ?
setSpaceBottom() API does not work for me. I noticed that this item has been closed, but what was the solution? Can you pls share?
mChart.getAxisLeft().setStartAtZero(false);
I have set the setStartAtZero to false, but it still does not work. This is how my code looks; YAxis leftYAxis = mGraphView.getAxisLeft(); leftYAxis.setStartAtZero(false); leftYAxis.setSpaceBottom(50f); leftYAxis.setSpaceTop(50f); leftYAxis.setAxisMinValue(0); leftYAxis.setAxisMaxValue(3); leftYAxis.setLabelCount(4, true); LineData lineData = new LineData(); lineData.setValueFormatter(new MyValueFormatter()); mGraphView.setData(lineData);