0) { $i = 0; // cycle over charts while ($chart = mysql_fetch_array($charts)) { // retrieve both generic as the specific data $category = $chart['category']; $type = $chart['type']; $color = $chart['color']; $layout = $chart['layout']; $charttype = $chart['charttype']; $columns = $chart['columns']; $title = $chart['title']; $data = unserialize(gzdecode($chart['data'])); $labels = unserialize(gzdecode($chart['labels'])); $categories = unserialize(gzdecode($chart['categories'])); // append previous chart - this is done to ensure proper outlining (can only know in +1 round) $chartOutput .= $prevRenderedChart; // print a new section if we're now in a different category if ($category != $prevCategory) { if(strlen($prevCategory) > 0) $chartOutput .= renderFootBlock(); $chartOutput .= renderHeaderBlock($category); $prevCategory = $category; } else { if ($i>1 && $i%2 == 0) $chartOutput .= ""; else $chartOutput .= ""; } $prevRenderedChart = renderChart($mid."-".$i,$layout,$color,$title,$data,$labels,$categories,$renderer_width*$columns,$renderer_heigth,$charttype); $i++; } // finishing up $chartOutput .= $prevRenderedChart; $chartOutput .= renderFootBlock(); echo ' '; echo $chartOutput; } ?>