cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Pie Chart Display

Former Member
0 Kudos

Hi this is Prasad,

I want to display a pie chart with the associated results from the query template.It is working fine if I have any values in the database.I want to Display the Text 'No Data is Found' if i dont have data in the database.Is it possible to display like this.Can anyone help on this.

Thanks,

Prasad.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ram

Use a hidden grid by using same query.

Get the rowcount of your applet.If row count is zero, then hide the applet and display the message.

document.appletname.style.visibility="hidden";

document.appletname.style.visibility = "visible";

try like this.

Former Member
0 Kudos

Thanks for your Quick Reply.Can we display the Pie chart without calculating rowcount.Means instead of hiding the applet can we show the message.

Former Member
0 Kudos

Hi Ram

Try like this:

Use icommand instead of hidden grid.Use getRowCount() to get the no of rows.if it is zero display the alert message and pie chart will come as blank.

Answers (1)

Answers (1)

jcgood25
Active Contributor
0 Kudos

The 'No Data Available' message only displays when a fatal error occurs but not 0 rows (not desirable in this case). How about adding the UpdateEvent in your PARAM tags and in the corresponding function doing something like this:

var myApplet = document.APPLETNAME;

var myChart = myApplet.getChartObject();

if (parseInt(myChart.getNumberOfDataPoints(1)) > 0) {

myChart.setTitle("You have pie slices");

} else {

myChart.setTitle("No Records Found");

}

myApplet.setUpdateEventEnabled(false);

myApplet.updateChart(false);

myApplet.setUpdateEventEnabled(true);

This should allow you to use standard stuff and not incorporate monkey business with hidden/visible divs and/or additional applets just for running separate queries.