MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

How to draw circles at any Entry?

Open kazetani opened this issue 6 years ago • 2 comments

image

I want to circle any entry in a real time line chart. But, setDrawCircles(true/false) then all entries will be circled. How to circle an arbitrary entry like an image?

kazetani avatar Nov 29 '19 07:11 kazetani

Hello @kazetani . I think It seems not easy. but I have an idea, hope this helps.

Dataset class has setDrawCircles(true/false) method and setCircleColors(colorlist) as well. You can change the circle color whatever you want even if transparent color, if use the method.

For example, you have 5 entries total and want draw circle only index 2, 4. You can make expected line bar use the code below.

ArrayList<Integer> colors = new ArrayList<>();
colors.add(Color.TRANSPARENT);
colors.add(Color.BLUE);
colors.add(Color.TRANSPARENT);
colors.add(Color.BLUE);
colors.add(Color.TRANSPARENT);

dataset.setDrawCircles(true);
dataset.setCircleColors(colors);

Dagzo avatar Dec 13 '19 02:12 Dagzo

How can I change it on runtime? like when I drag from 2nd point to 3rd point, that circle should move to 3rd circle. wherever vertical lines moves, circles should move with vertical line, other circle should remove or transparent

dhvani023 avatar Jul 20 '23 10:07 dhvani023