hongyin163 / react-native-chart-android

react native chart modules come from mpandroidchart.
206 stars 81 forks source link

Have any way to cancel the blank below the zero of Yaxis #79

Closed RichardSleet closed 1 year ago

RichardSleet commented 7 years ago

screenshot_20170515-094336

hongyin163 commented 7 years ago

https://github.com/PhilJay/MPAndroidChart/wiki/YAxis

YAxis yAxis = mChart.getAxisLeft(); yAxis.setTypeface(...); // set a different font yAxis.setTextSize(12f); // set the text size yAxis.setAxisMinimum(0f); // start at zero yAxis.setAxisMaximum(100f); // the axis maximum is 100 yAxis.setTextColor(Color.BLACK); yAxis.setValueFormatter(new MyValueFormatter()); yAxis.setGranularity(1f); // interval 1 yAxis.setLabelCount(6, true); // force 6 labels //... and more

hongyin163 commented 7 years ago

start at zero

hongyin163 commented 7 years ago

private void setYAxisInfo(YAxis axis,ReadableMap v){ if(v.hasKey("startAtZero")) axis.setStartAtZero(v.getBoolean("startAtZero")); if(v.hasKey("axisMaxValue")) axis.setAxisMaxValue((float) v.getDouble("axisMaxValue"));