MPAndroidChart PieChart how to change the center text to display the different color and font size

后端 未结 4 1469
轮回少年
轮回少年 2021-02-11 07:36

Currently I use the MPAndroidChart from GITHUB and draw the piechart to display the two line text, each line has different color and different font size,I check the source codes

4条回答
  •  一生所求
    2021-02-11 07:58

    You can accomplish this without modifying MPAndroidChart source by nesting your com.github.mikephil.charting.charts.PieChart component and your center text within a RelativeLayout in your activity layout. You can use a LinearLayout component to format your center text rows.

    
        
        
        
            
            
            
            
        
    
    

    Be careful to place your LinearLayout containing your center text below your PieChart component. Here is the end result.

提交回复
热议问题