Reputation: 19
Suppose if I have multiple lines and one line I want to hide. How to do this? removeDataset
will remove complete line but I just want to hide the line. Is it possible in this chart API?
Upvotes: 1
Views: 1077
Reputation: 11
I know it is a bit late but I would suggest setting the color to transparent for the LineDataSet
.
Define the color:
<color name="alpha">#00FFFFFF</color>
and set it
LineDataSet lineToBeHidden; lineToBeHidden.setColor(ResourceCompat.getColor(getResources(), R.color.alpha, null);
Additionally you can set the width to minimum lineToBeHidden.setLineWidth(0.2f)
to maximize the performance.
Upvotes: 0
Reputation: 71
Using the Dashline feature we can solve this,set length to 0 to draw only the dots: dataSet.enableDashedLine(0f,1f,0f)
Upvotes: 3
Reputation: 11
Actually you can not "hide" a line in a linechart.
But you can register your lines in different array and set the array you need in your chart and notify your chart to refresh with the good array. (The one with / without your line)
This is simple and fast to set.
Hope it helps.
Upvotes: 0