YAxis leftAxis = mLineChart.getAxisLeft(); leftAxis.setTextColor(ContextCompat.getColor(act, R.color.grey_400)); // leftAxis.setAxisMaxValue(maxValue < 12 ? 12 : maxValue + 5); leftAxis.setAxisMaxValue(3.0f); leftAxis.setAxisMinValue(0.0f); leftAxis.setDrawGridLines(false); leftAxis.setDrawAxisLine(false); leftAxis.setLabelCount(6); leftAxis.setSpaceBottom(0); leftAxis.setStartAtZero(true); // leftAxis.setValueFormatter(new AxisValueFormatter() { // String[] tempValues = new String[]{"0.0", "0.5", "1.0", "1.5","2.0","2.5","3.0"}; // @Override // public String getFormattedValue(float v, AxisBase axisBase) { // return String.valueOf((((int) v) == 0 ? "" : (int) v)); Log.i("info","当前下标"+(int)(v % tempValues.length)+
MPAndroidChart、Y轴显示小数点
最新推荐文章于 2024-04-19 22:57:45 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)