本文介绍了MPAndroid折线图带有曲线的单个数据点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要如下的折线图.我只想显示指定的点(蓝色的圆圈应该在那儿)(红色的圆圈应该不在那儿).
I want linechart as follows. I want to show only specified point (blue circled should be there) (red circled should not be there).
推荐答案
我想到了2种方法.
第一:禁用所有点和值
First:disable all points and values with
lineDataSet.setDrawValues(dataSet.drawValues);
lineDataSet.setDrawCircles(dataSet.drawValues);
然后在LineChart
中添加另一个LineDataSet
,仅包含该最大值的那一点.此解决方案会在图例"中添加一个附加条目.
Then add another LineDataSet
to the LineChart
only containing that one point for the Maximum.This solution causes an additional entry in the Legend.
另一种解决方案是自定义MarkerView
,如
The other solution would be a custom MarkerView
like described here
这篇关于MPAndroid折线图带有曲线的单个数据点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!