Exemplo n.º 1
0
                    $chart_width = !empty($_GET['chart_width']) ? $_GET['chart_width'] : $report->chart_width;
                    $chart_height = !empty($_GET['chart_height']) ? $_GET['chart_height'] : $report->chart_height;
                    $chart_type = !empty($_GET['chart_type']) ? $_GET['chart_type'] : $report->chart_type;
                    $chart_legend = !empty($_GET['chart_legend']) ? $_GET['chart_legend'] : $report->chart_legend;
                    $chart_label = !empty($_GET['chart_label']) ? $_GET['chart_label'] : $report->chart_label;
                    $chart_value = !empty($_GET['chart_type']) ? $_GET['chart_value'] : $report->chart_value;
                    //getSvgData($result, $legend_name, $chart_label, $chart_value, $legend, $labels, $data);
                    $svgimg->setProperty('_chart_name', $report->report_name);
                    $svgimg->setProperty('_chart_width', $chart_width);
                    $svgimg->setProperty('_chart_height', $chart_height);
                    $svgimg->setProperty('_chart_type', $chart_type);
                    $svgimg->result = $result;
                    $svgimg->legend_name = str_replace('.', '__', $chart_legend);
                    $svgimg->chart_label = str_replace('.', '__', $chart_label);
                    $svgimg->chart_value = str_replace('.', '__', $chart_value);
                    $svg_chart = $svgimg->getSvgChart_forView();
                    echo '<div id="return_divId">' . $svg_chart . '</div>';
                }
            } else {
                return false;
            }
        }
    }
}
function getSvgData($result, $legend_name, $chart_label, $chart_value, &$legend, &$labels, &$data)
{
    $result1 = $result;
    foreach ($result as $obj) {
        if (!empty($legend_name)) {
            if (!in_array($obj->{$legend_name}, $legend)) {
                array_push($legend, $obj->{$legend_name});