function render() { global $osC_Language; $value_total = array_sum($this->data); $pie_chart = new toC_Flash_Pie('', null, null, '{display:none}'); $pie_chart->setData($this->data); echo '<table cellpadding="2" cellspacing="0" border="0" class="dataTable" width="100%">'; if (!empty($this->table_head_data) && is_array($this->table_head_data)) { echo '<thead>'; echo '<tr>'; echo '<th>' . $this->table_head_data[0] . '</th>'; echo '<th>' . $this->table_head_data[1] . '</th>'; if ($this->display_percentage_column === true) { echo '<th>' . $osC_Language->get('table_head_percentage') . '</th>'; } echo '<th> </th>'; echo '</tr>'; echo '</thead>'; } echo '<tbody>'; if (is_array($this->data) && sizeof($this->data) > 0) { $i = 0; $chart_displayed = false; foreach ($this->data as $label => $value) { echo '<tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);" >'; echo '<td><font style="background-color:' . $pie_chart->pie_slice_colours[$i % 12] . '"> </font> ' . $label . '</td>'; echo '<td>' . $value . '</td>'; if ($this->display_percentage_column === true) { echo '<td>' . sprintf('%.2f%%', $value * 100 / $value_total) . '</td>'; } if ($chart_displayed === false) { echo '<td rowspan="' . $value_total . '" style="background-color:' . $pie_chart->getBgColor() . '" align="center" valign="middle" width="' . ($pie_chart->getWidth() + 50) . '">'; echo $pie_chart->render(); echo '</td>'; $chart_displayed = true; } $i++; } } else { echo '<tr><td colspan="4" align="center">' . $osC_Language->get('no_data_available') . '</td></tr>'; } echo '</tbody>'; echo '</table>'; }