Ama*_*alo 6 charts android android-studio android-typeface mpandroidchart
我有一个使用库MPAndroidChart的折线图
mChart.setData(data);
mChart.getAxisLeft().setTypeface(MyApplication.giloryItaly);
mChart.invalidate();
mChart.getXAxis().setTypeface(MyApplication.giloryItaly);
mChart.getAxisRight().setTypeface(MyApplication.giloryItaly);
Run Code Online (Sandbox Code Playgroud)
问题是,AxisLeft即使使用,字体值也无法更改
mChart.getAxisLeft().setTypeface(MyApplication.giloryItaly);
Run Code Online (Sandbox Code Playgroud)
但适用于 XAxis
任何解决方案如何改变字体类型的AxisLeft和AxisRight?
在你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);
Run Code Online (Sandbox Code Playgroud)
请检查样式/修改轴
| 归档时间: |
|
| 查看次数: |
1294 次 |
| 最近记录: |