chart.getAxisLeft().setStartAtZero(false); chart.getAxisRight().setStartAtZero(false); chart.getAxisLeft().setDrawGridLines(false); chart.getAxisRight().setDrawGridLines(false); chart.getXAxis().setDrawGridLines(false); chart.getAxisLeft().setValueFormatter(new GraphValueFormatter()); chart.getAxisRight().setValueFormatter(new GraphValueFormatter()); chart.setDrawBorders(false); chart.getAxisLeft().setAxisMaxValue(PitchCalculator.maxPitch.floatValue()); chart.getAxisRight().setAxisMaxValue(PitchCalculator.maxPitch.floatValue()); chart.getAxisRight().setAxisMinValue(PitchCalculator.minPitch.floatValue()); chart.getAxisLeft().setAxisMinValue(PitchCalculator.minPitch.floatValue()); chart.getAxisLeft().setValueFormatter(new GraphValueFormatter()); chart.getAxisRight().setValueFormatter(new GraphValueFormatter()); chart.setDrawBorders(false); chart.getAxisLeft().setAxisMinValue(PitchCalculator.minMalePitch.floatValue()); chart.getAxisRight().setAxisMinValue(PitchCalculator.minMalePitch.floatValue());
protected void setup(Chart<?> chart) { mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf"); // no description text chart.getDescription().setEnabled(false); // enable touch gestures chart.setTouchEnabled(true); if (chart instanceof BarLineChartBase) { BarLineChartBase mChart = (BarLineChartBase) chart; mChart.setDrawGridBackground(false); // enable scaling and dragging mChart.setDragEnabled(true); mChart.setScaleEnabled(true); // if disabled, scaling can be done on x- and y-axis separately mChart.setPinchZoom(false); YAxis leftAxis = mChart.getAxisLeft(); leftAxis.removeAllLimitLines(); // reset all limit lines to avoid overlapping lines leftAxis.setTypeface(mTf); leftAxis.setTextSize(8f); leftAxis.setTextColor(Color.DKGRAY); leftAxis.setValueFormatter(new PercentFormatter()); XAxis xAxis = mChart.getXAxis(); xAxis.setTypeface(mTf); xAxis.setPosition(XAxis.XAxisPosition.BOTTOM); xAxis.setTextSize(8f); xAxis.setTextColor(Color.DKGRAY); mChart.getAxisRight().setEnabled(false); } }