MPAndroid Line Chart single data point with curve

百般思念 提交于 2020-01-15 09:06:46

问题


I want linechart as follows. I want to show only specified point (blue circled should be there) (red circled should not be there).


回答1:


I think of 2 methods.

First: disable all points and values with

lineDataSet.setDrawValues(dataSet.drawValues);
lineDataSet.setDrawCircles(dataSet.drawValues);

Then add another LineDataSet to the LineChart only containing that one point for the Maximum. This solution causes an additional entry in the Legend.

The other solution would be a custom MarkerView like described here




回答2:


To do that first of all set your point colors to transparent as:

dataset.setCircleColor(Color.TRANSPARENT);
dataset.setCircleColorHole(Color.TRANSPARENT);

Then after that Highlight specific point as:

Highlight highlight = new Highlight(50f, 0); 
chart.highlightValue(highlight, false);

Insert your point instead of (50f,0). Never tried just think that we may do this in that way.Try this and do let me know if it works buddy :)



来源:https://stackoverflow.com/questions/47177157/mpandroid-line-chart-single-data-point-with-curve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!