I have a line chart using the library MPAndroidChart
mChart.setData(data);
mChart.getAxisLeft().setTypeface(MyApplication.giloryItaly);
mChart.invalidate();
mChart.getXAxis().setTypeface(MyApplication.giloryItaly);
mChart.getAxisRight().setTypeface(MyApplication.giloryItaly);
The problem is the AxisLeft
font value cannot be changed even when using
mChart.getAxisLeft().setTypeface(MyApplication.giloryItaly);
but works well for XAxis
Any solution how to change font type for AxisLeft
and AxisRight?
In you linechart
, Use
LineChart horizontalPChartLine = (LineChart) findViewById(R.id.horizontalPChartLine);
XAxis xAxis = horizontalPChartLine.getXAxis();
xAxis.setTypeface(tf);
xAxis.setTextSize(12f);
xAxis.setTextColor(ColorTemplate.getHoloBlue());
xAxis.setEnabled(true);
please check Styling / modifying the axis
Paint p = mChart.getPaint(Chart.PAINT_INFO);
p.setTextSize(...);
p.setColor(...);
p.setTypeface(...);
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