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