MPAndroidChart - Change message “No chart data available”

后端 未结 6 2153
予麋鹿
予麋鹿 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:50

    It's a little bit old thread, but I had the same issue so my solution was to set nodatatext immediately after the initialization of a chart:

    PieChart pieChart = findViewById(R.id.chart) //in case of fragment view.findViewById(R.id.chart)
    pieChart.setNoDataText("Loading");
    

提交回复
热议问题