我有一个使用库 MPAndroidChart
的折线图 mChart.setData(data);
mChart.getAxisLeft().setTypeface(MyApplication.giloryItaly);
mChart.invalidate();
mChart.getXAxis().setTypeface(MyApplication.giloryItaly);
mChart.getAxisRight().setTypeface(MyApplication.giloryItaly);
问题是即使使用
也无法更改AxisLeft
字体值
mChart.getAxisLeft().setTypeface(MyApplication.giloryItaly);
但适用于XAxis
AxisLeft
和AxisRight?
答案 0 :(得分:4)
在你linechart
中,使用
LineChart horizontalPChartLine = (LineChart) findViewById(R.id.horizontalPChartLine);
XAxis xAxis = horizontalPChartLine.getXAxis();
xAxis.setTypeface(tf);
xAxis.setTextSize(12f);
xAxis.setTextColor(ColorTemplate.getHoloBlue());
xAxis.setEnabled(true);
答案 1 :(得分:1)
Paint p = mChart.getPaint(Chart.PAINT_INFO);
p.setTextSize(...);
p.setColor(...);
p.setTypeface(...);