Android MPChartLibrary cannot override default value "No chart data available"

I am using Android-MPChartLibrary to show LineChart. An empty view for LineChart shows "No chart data available" and "No data to display" enter image description here

 chart.setDescription(""); chart.setNoDataTextDescription("No data to display"); 

I just want him to say β€œNo data to display”, but not sure why he shows both.

+5
source share
3 answers

What worked for me is to put this after setting all the data points of the chart.

 chart.setDescription(""); chart.setNoDataText("No Chart Data"); // this is the top line chart.setNoDataTextDescription("..."); // this is one line below the no-data-text chart.invalidate(); 
+9
source
 chart.setDescription(null); chart.setNoDataText("No data to display"); 

And after:

 chart.invalidate(); 
+2
source
 mainLayout = (PieChart) findViewById(R.id.chart); mChart = new PieChart(this); mChart.invalidate(); mainLayout.setNoDataText(""); 

You must setNoDataText for mainLayout not for mChart .

+1
source

All Articles