Hiding bars with zero count from Multi-series Bar 3D Chart

This public forum is for user-to-user discussions of PHP Report Maker. Note that this is not support forum.

Hiding bars with zero count from Multi-series Bar 3D Chart

Postby ppinto » Sat Sep 23, 2017 2:17 am

Hi,

I have a Multi-series Bar 3D Chart (in a crosstab report) that for each Department (X axis) displays a document count (Y axis) per employee (series field).
However, when an employee's document count is zero, I don't want it plotted in the chart.
I searched the fusioncharts forums for an answer and found a partial solution. I managed to hide the bars using this code in the Chart_Rendered (server) function:

if ($this->ID == "reportname_Chart1") {
$chartxml = str_replace('"0.00"', '""', $chartxml); //if document count = 0, don't plot bar
}

This works. Problem is, I don't see the zero document bars (as desired), but the empty space (where they appeared before) is still there. I'd like to have the bar gone from the chart and its free space gone too.
Can anyone point me in the right direction? Thanks!
ppinto
 
Posts: 61
Joined: Wed Nov 28, 2012 12:55 am

Re: Hiding bars with zero count from Multi-series Bar 3D Cha

Postby Webmaster » Sat Sep 23, 2017 1:14 pm

Unfortunately the answer seemed to be no.

You can however change the display data using the Chart_DataRendered server event. For example:

if ($this->ID == "<Table>_<Chart>") {
if ($node->nodeName == "set") { // Show no data if zero
$val = $node->getAttribute("value");
if ($val == "0.00") {
$node->setAttribute("value", "");
$node->setAttribute("displayValue", "No data");
}
}
}
Webmaster
 
Posts: 10734
Joined: Fri Aug 06, 2004 5:59 pm

Re: Hiding bars with zero count from Multi-series Bar 3D Cha

Postby ppinto » Mon Sep 25, 2017 10:57 pm

Thanks!
ppinto
 
Posts: 61
Joined: Wed Nov 28, 2012 12:55 am


Return to General Discussion (PHP Report Maker)