I am using MPAndroidChart to make charts in Android app.
I need to make circle blue with just white border of that circle, like this on the image below.
This is my code:
LineDataSet set1 = new LineDataSet(yVals,"DataSet");
set1.setFillAlpha(65);
set1.setFillColor(Color.RED);
set1.setColor(Color.WHITE);
set1.setCircleColor(Color.BLUE);
set1.setLineWidth(2f);
set1.setCircleSize(5f);
set1.setDrawValues(false);
And this is the result:
From the image above, it looks like you need to use setCircleColorHole(int color)
.
According to the docs:
Sets the color of the inner circle of the line-circles
So this may be what you are after:
LineDataSet set1 = new LineDataSet(yVals,"DataSet");
set1.setFillAlpha(65);
set1.setFillColor(Color.RED);
set1.setColor(Color.WHITE);
set1.setCircleColor(Color.WHITE);
set1.setCircleColorHole(Color.BLUE)
set1.setLineWidth(2f);
set1.setCircleSize(5f);
set1.setDrawValues(false);
I haven't used this library but you may also need to add setDrawCircleHole(true)
should that not work on its own.
If this is done within a fragment
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
trendsDataSet.setCircleColor(getActivity().getColor(R.color.colorAccent));
trendsDataSet.setCircleHoleColor(getActivity().getColor(R.color.colorAccent));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With