コード例 #1
0
ファイル: charts.php プロジェクト: redsummit/anitaborg
    $Palette = array("0" => array("R" => 32, "G" => 74, "B" => 140, "Alpha" => 100), "1" => array("R" => 32, "G" => 74, "B" => 140, "Alpha" => 100), "2" => array("R" => 69, "G" => 43, "B" => 135, "Alpha" => 100), "3" => array("R" => 69, "G" => 43, "B" => 135, "Alpha" => 100));
    /* Draw the bar chart chart */
    $myPicture->setFontProperties(array("FontName" => "../pChart/fonts/verdana.ttf", "FontSize" => 10));
    $data->setSerieDrawable("Last year", FALSE);
    $myPicture->drawBarChart(array("DisplayPos" => LABEL_POS_INSIDE, "DisplayValues" => TRUE, "DisplayOrientation" => ORIENTATION_HORIZONTAL, "Surrounding" => 30, "OverrideColors" => $Palette, "DisplayColor" => DISPLAY_MANUAL, "DisplayR" => 255, "DisplayG" => 255, "DisplayB" => 255));
    $myPicture->drawThresholdArea($result->Benchmark_Low, $result->Benchmark_High, array("R" => 177, "G" => 221, "B" => 207, "Alpha" => 40));
    /* Make sure all series are drawable before writing the scale */
    $data->drawAll();
    /* Write the legend */
    //$myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
    //$myPicture->drawLegend(580,35,array("Style"=>LEGEND_ROUND,"Alpha"=>20,"Mode"=>LEGEND_HORIZONTAL));
    /* Render the picture (choose the best way) */
    //$myPicture->autoOutput("pictures/example.combo.png");
    $myPicture->Stroke();
} else {
    $entries = $tc->getEntries();
    $metrics = $tc->getScored();
    $option_values = '';
    foreach ($entries as $entry) {
        $option_values .= '<option value="' . $entry->Account->Id . '">' . $entry->Account->Name . '</option>';
    }
    $option_metrics = '';
    foreach ($metrics as $metric) {
        $idx = $metric->Question_ID__c . '';
        $option_metrics .= '<option value="' . $idx . '">' . $idx . ' - ' . $metric->Question_Text__c . '</option>';
    }
    print '<form method="get">';
    print '<input type="hidden" name="action" value="display" />';
    print '<p>Select the company to display:</p>';
    print '<p><select name="org">' . $option_values . '</select></p>';
    print '<p>Select the item to display:</p>';
コード例 #2
0
function getEntries()
{
    $tc = new TopCompanyResults();
    $entries = $tc->getEntries();
    return json_encode($entries);
}