Endra
Endra

Reputation: 23

Different colors in different plot points in line chart

I am using MpAndroidChart library to draw a line chart. I have a single LineDataSet with multiple entry points. We can customize the circle color of the LineDataSet but I need different colors for different plot points. How can we achieve this ?

Upvotes: 2

Views: 1463

Answers (1)

Muhammad Saad Rafique
Muhammad Saad Rafique

Reputation: 3189

Follow below code to set different colors for circles:

lineDataSet.setCircleColors(new int[]{Color.BLUE,Color.RED,Color.GREEN,Color.BLUE,Color.RED,Color.GREEN});

Here I am using six colors because my chart has six values. So number of colors should be according to the number of chart values.

Upvotes: 2

Related Questions