Android-MPchart折线图属性
LineChart为你LineLineChart控件
设置说明
LineChar.setDescription(null);
设置图例关
LineChart.getLegend().setEnabled(false);
设置显示范围
LineChart.setVisibleXRangeMaximum(2);
LineChart.setVisibleYRangeMinimum(4);
设置透明度
LineChart.setAlpha(1.0f);
设置背景色
LineChart.setBackgroundColor(Color.WHITE);
设置边框
LineChart.setBorderColor(Color.rgb(0, 0, 0));
LineChart.setGridBackgroundColor(R.color.colorPrimary);
设置触摸(关闭影响下面3个属性)
LineChart.setTouchEnabled(false);
设置是否可以拖拽
LineChart.setDragEnabled(true);
设置是否可以缩放
LineChart.setScaleEnabled(true);
设置是否能扩大扩小
LineChart.setPinchZoom(true);
XAxis为你XAxis名称
获取X轴
XAxis XAxis = LineChart.getXAxis();
启用X轴
XAxis.setEnabled(true);
设置X轴避免图表或屏幕的边缘的第一个和最后一个轴中的标签条目被裁剪
XAxis.setAvoidFirstLastClipping(true);
设置X轴