Reputation: 2411
I am using Android-MPChartLibrary for showing a LineChart. Empty view for LineChart
is showing "No chart data available" and "No data to display"
chart.setDescription("");
chart.setNoDataTextDescription("No data to display");
I just want it to say "No data to display" but not sure why it is showing both.
Upvotes: 5
Views: 5644
Reputation: 41
You have to just write these two lines in the onCreate method.
LineChart line = (LineChart) findViewbyId(R.id.line);
line.setNoDataText("");
That's it. Your by default text no data available text is gone now.
Upvotes: 0
Reputation: 57
mainLayout = (PieChart) findViewById(R.id.chart);
mChart = new PieChart(this);
mChart.invalidate();
mainLayout.setNoDataText("");
You must setNoDataText
for your mainLayout
not for mChart
.
Upvotes: 1
Reputation: 2411
What worked for me was putting this after setting all the chart data points.
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();
Upvotes: 10
Reputation: 2555
chart.setDescription(null);
chart.setNoDataText("No data to display");
And after:
chart.invalidate();
Upvotes: 2