"no data" label

4,452 views
Skip to first unread message

Wesley Chin

unread,
Jul 16, 2012, 9:30:18 AM7/16/12
to google-visua...@googlegroups.com
Hi there,

I have a bar chart which I created and works perfectly.  All I want to know is is there a way to display the message "no data" on the bar chart area like the pie chart when there is no data?  Currently, when there is no data to be displayed, it is showing the chart but with no bars.  

Thanks,
Wesley

tanmay_dg

unread,
Jul 19, 2012, 8:47:25 AM7/19/12
to google-visua...@googlegroups.com
Hi Wesley,
I'm facing the same issue. Based on the data selected by user I want to show "No Data" in Line, Bubble and Column Charts. Unlike you my Chart is not even drawing chart without the column. It just shows an error message saying not enough columns to draw chart. Did you find a solution for this?

Thanks
Tanmay

visigoth

unread,
Jul 19, 2012, 10:54:15 AM7/19/12
to google-visua...@googlegroups.com
Unfortunately, our charts are indeed inconsistent in their handling of empty data tables.
Please feel free to report the issue here.

Tanmay Verma

unread,
Aug 3, 2012, 10:18:02 AM8/3/12
to google-visua...@googlegroups.com, google-visua...@googlegroups.com
Hi,
I found a temporary solution to this. When I draw charts and the data table is empty my column and bubble charts give error. The error is displayed in a span div. I binder and error event with the charts and in the method removed the span div and added the div which says no data in the same format as pie chart. The only problem with this is you cannot get the container id from the error event so container ids need to be hardcoded.

Tanmay

Sent from my iPad
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/oMnILKqazDcJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Alessandro Gatti

unread,
Aug 29, 2018, 2:22:19 PM8/29/18
to Google Visualization API
Hi, i also had this issue, i found a solution: use the pie chart message calling piechart template with no data on the container you want to show "No Data" message, without know about how to show this message on other kind of charts:

drawPieTemplate(array1,container1);

if (array2.length==0){
   drawPieTemplate(array2,container2);
} else {
   drawBarTemplate(array2,container2);
}

My suggestion is to prepare pietemplate, bartemplate, columntemplate, ... functions with data and container as parameters so you can do it easily!

Alessandro
Reply all
Reply to author
Forward
0 new messages