MPAndroidChart - Change message “No chart data available”

后端 未结 6 2134
予麋鹿
予麋鹿 2020-12-29 22:22

Is there any way to change the message \"No chart data available\" when the chart is not populated?

Edit: Found the answer



        
6条回答
  •  感情败类
    2020-12-29 22:47

    The Correct answer is here:

     pie_chart.setNoDataText("No Data Available");
     val paint:Paint =  pie_chart.getPaint(Chart.PAINT_INFO)
     paint.textSize = 40f
     pie_chart.invalidate()
    

    You also set other properties like text color, text typeface etc

提交回复
热议问题