The exact same query returns an empty screen instead of displaying the chart. It works fine without the ChartDirector query, but it doesn't return anything when the ChartDirector query is included. I apologize if I’m not explaining this clearly. I would appreciate any help you can provide.
SELECT 'dbr.chart', 'Column', 'Growth Percentage';
SELECT 'dbr.chart.options', 'bargap', 0.35;
SELECT 'dbr.chart.options', 'chartdirector', '
$decline_color = 0x33CC33;
$growth_color = 0xFF1D1D;
$arrow_color = 0x000000;
for ($ds=0; $ds < $layer->getDataSetCount()-1; $ds++) {
$fromVal = $layer->getDataSet($ds)->getValue($ds);
$toVal = $layer->getDataSet($ds+1)->getValue($ds+1);
$same_value = $fromVal==$toVal;
$percent = sprintf("%+d%%", -1* round(($toVal - $fromVal)/$fromVal*100,0));
$x = $c->getXCoor($ds)+($c->getXCoor($ds+1)-$c->getXCoor($ds))/2;
if ($fromVal!=$toVal) {
$c->addLine( $x, $c->getYCoor($fromVal), $x, $c->getYCoor($toVal), $arrow_color,3 );
}
if ($fromVal<=$toVal) {
if (!$same_value) {
$c->addLine( $x+4, $c->getYCoor($toVal)+4, $x, $c->getYCoor($toVal), $arrow_color,3 );
$c->addLine( $x, $c->getYCoor($toVal), $x-4, $c->getYCoor($toVal)+4, $arrow_color,3 );
}
$c->addText($x, $c->getYCoor($toVal)-14, $percent, "", 8, $same_value ? 0x000000 : $decline_color, TopCenter);
} else {
$c->addLine( $x-4, $c->getYCoor($toVal)-4, $x, $c->getYCoor($toVal), $arrow_color,3 );
$c->addLine( $x, $c->getYCoor($toVal), $x+4, $c->getYCoor($toVal)-4, $arrow_color,3 );
$c->addText($x, $c->getYCoor($toVal)+14, $percent, "", 8, $growth_color, BottomCenter);
}
}
';
SELECT 'Jan' as d, 15 as v
UNION
SELECT 'Feb', 20
UNION
SELECT 'March', 05
UNION
SELECT 'April', 25
UNION
SELECT 'May', 50
;