Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPAndroidChart Line Cap / End Style

If you draw a thick line in MPAndroidChart, then it looks like this

enter image description here

Is there a line join or line cap style that I can set to make the lines look like this?

enter image description here

NOTE: I do not want cubic or spline interpolation, just a nice join for thick lines

like image 371
Dr. Andrew Burnett-Thompson Avatar asked Sep 12 '25 04:09

Dr. Andrew Burnett-Thompson


1 Answers

I haven't worked with the LineChart, but maybe you could use the circles that act as the data points to your advantage.

You might be able to get away with setting the circle color to match your line color, and then adjust the circle size to match your line size, as you said it's thicker than the default value.

In looking at the MPAndroidChart github files (the LineDataSet.java file to be specific), I'd try setCircleColors(List colors), and then setCircleRadius(float radius) to get the desired results.

Here's a link to that file as a reference; https://github.com/PhilJay/MPAndroidChart/blob/master/MPChartLib/src/com/github/mikephil/charting/data/LineDataSet.java

like image 106
web dever Avatar answered Sep 13 '25 18:09

web dever