Пример #1
0
$pdf->SetFont($config->ParameterArray["PDFfont"], '', 8);
$pdf->SetFillColor(0, 0, 0);
$pdf->SetTextColor(255);
$pdf->SetDrawColor(128, 0, 0);
$pdf->SetLineWidth(0.3);
$pdf->SetfillColor(224, 235, 255);
$pdf->SetTextColor(0);
$pdf->SetFont($config->ParameterArray["PDFfont"], "", 12);
if (function_exists('money_format')) {
    $pdf->Cell(300, 5, __("Annual Cost Per Rack Unit (Year)") . ': ' . money_format("%.2n", $annualCostPerUYear), "", 1, "L", "");
    $pdf->Cell(300, 5, __("Annual Cost Per Watt (Year)") . ': ' . money_format("%.4n", $annualCostPerWattYear), "", 1, "L", "");
} else {
    $pdf->Cell(300, 5, __("Annual Cost Per Rack Unit (Year)") . ': ' . sprintf($annualCostPerUYear, "%.2n"), "", 1, "L", "");
    $pdf->Cell(300, 5, __("Annual Cost Per Watt (Year)") . ': ' . sprintf($annualCostPerWattYear, "%.4n"), "", 1, "L", "");
}
$pdf->Ln();
$pdf->Ln();
$pdf->Bookmark("Departments");
$deptList = $dept->GetDepartmentList();
foreach ($deptList as $deptRow) {
    // Skip ITS for Now
    // if ( $deptRow->Name == "ITS" )
    // 	continue;
    $pdf->AddPage();
    $pdf->Bookmark($deptRow->Name, 1, 0);
    $pdf->SetFont($config->ParameterArray["PDFfont"], "B", 12);
    $pdf->Cell(80, 5, __("Department") . ":");
    $pdf->SetFont($config->ParameterArray["PDFfont"], "", 12);
    $pdf->Cell(0, 5, $deptRow->Name);
    $pdf->Ln();
    $pdf->SetFont($config->ParameterArray["PDFfont"], "B", 12);
Пример #2
0
<?php

require 'diag.php';
$pdf = new PDF_Diag();
$pdf->AddPage();
$data = array('Men' => 1510, 'Women' => 1610, 'Children' => 1400);
//Pie chart
$pdf->SetFont('Arial', 'BIU', 12);
$pdf->Cell(0, 5, '1 - Pie chart', 0, 1);
$pdf->Ln(8);
$pdf->SetFont('Arial', '', 10);
$valX = $pdf->GetX();
$valY = $pdf->GetY();
$pdf->Cell(30, 5, 'Number of men:');
$pdf->Cell(15, 5, $data['Men'], 0, 0, 'R');
$pdf->Ln();
$pdf->Cell(30, 5, 'Number of women:');
$pdf->Cell(15, 5, $data['Women'], 0, 0, 'R');
$pdf->Ln();
$pdf->Cell(30, 5, 'Number of children:');
$pdf->Cell(15, 5, $data['Children'], 0, 0, 'R');
$pdf->Ln();
$pdf->Ln(8);
$pdf->SetXY(90, $valY);
$col1 = array(100, 100, 255);
$col2 = array(255, 100, 100);
$col3 = array(255, 255, 100);
$pdf->PieChart(100, 35, $data, '%l (%p)', array($col1, $col2, $col3));
$pdf->SetXY($valX, $valY + 40);
//Bar diagram
$pdf->SetFont('Arial', 'BIU', 12);