コード例 #1
0
            } else {
                array_push($services, $data[$c]);
            }
        }
    }
}
require_once "/var/www/ChartDirector/lib/phpchartdir.php";
# Create a PieChart object of size 360 x 300 pixels
$c = new PieChart(770, 390);
# Set the center of the pie at (180, 140) and the radius to 100 pixels
$c->setPieSize(470, 200, 180);
# Add a title to the pie chart
$c->addTitle($display_date . ' / ' . $display_geo . ' / ' . $display_searchtype);
# Set the color palette
$colors = array(0x378a30, 0x71cb68, 0x276a21, 0x7bb372, 0xe8fee7, 0x5d9758, 0x355e72, 0x6699b6, 0x6a9db8, 0x7fb0ce, 0x95c8e5, 0x699cb9, 0xd47710, 0xde8a30, 0xd37108, 0xd29039, 0xf29e43, 0xee7d05);
# Set the font
$c->setLabelStyle("arial.ttf", 9);
# Set the sector colors
$c->setColors2(DataColor, $colors);
# Set the gradient
$c->setSectorStyle(LocalGradientShading);
# Draw the pie in 3D
$c->set3D();
$c->addLegend(0, 30);
$c->setLabelFormat("{percent}%");
# Set the pie data and the pie labels
$c->setData($searches, $services);
# Explode the 1st sector (index = 0)
$c->setExplode(0);
$filename = $path . "/provider/charts/tempimages/" . $imagename;
$c->makeChart($filename);
コード例 #2
0
            } else {
                array_push($matchtype, $data[$c]);
            }
        }
    }
}
require_once "/var/www/ChartDirector/lib/phpchartdir.php";
# Create a PieChart object of size 360 x 300 pixels
$c = new PieChart(780, 390);
# Set the center of the pie at (180, 140) and the radius to 100 pixels
$c->setPieSize(410, 215, 195);
# Add a title to the pie chart
$c->addTitle($display_date);
# Set the color palette
$colors = array(0x3e8e35, 0x8fc28a, 0x2c7524, 0xe38919, 0xf8930d, 0xa86916, 0xc2965d);
# Set the font
$c->setLabelStyle("arial.ttf", 10);
# Set the sector colors
$c->setColors2(DataColor, $colors);
# Set the gradient
$c->setSectorStyle(LocalGradientShading);
# Draw the pie in 3D
$c->set3D();
$c->addLegend(0, 0);
$c->setLabelFormat("{percent}%");
# Set the pie data and the pie labels
$c->setData($count, $matchtype);
# Explode the 1st sector (index = 0)
$c->setExplode(0);
$filename = $path . "/provider/charts/tempimages/" . $imagename;
$c->makeChart($filename);
コード例 #3
0
    $servicecategoryname = array();
    $numsearches = array();
    while ($rs = pg_fetch_array($res_pop_services)) {
        array_push($servicecategoryname, trim($rs['servicecategoryname']));
        array_push($numsearches, trim($rs['numsearches']));
    }
    require_once "/var/www/ChartDirector/lib/phpchartdir.php";
    # Create a PieChart object of size 360 x 300 pixels
    $c = new PieChart(720, 390);
    # Set the center of the pie at (180, 140) and the radius to 100 pixels
    $c->setPieSize(410, 270, 110);
    # Add a title to the pie chart
    $c->addTitle("Most popular services in my area");
    # Draw the pie in 3D
    $c->set3D();
    $c->addLegend(10, 60);
    $c->setLabelFormat("{percent}%");
    # Set the pie data and the pie labels
    $c->setData($numsearches, $servicecategoryname);
    # Explode the 1st sector (index = 0)
    $c->setExplode(0);
    if ($data1 == 1) {
        $filename = $path . "/provider/charts/defaultimages/" . $imagename;
    } else {
        $filename = $path . "/provider/charts/tempimages/" . $imagename;
    }
    if (file_exists($filename)) {
        unlink($filename);
    }
    $c->makeChart($filename);
}