Recommend this page to a friend! |
Download .zip |
Info | Example | Screenshots | View files (11) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2016-06-09 (4 months ago) | 80% | Total: 183 This week: 4 | All time: 7,950 This week: 267 |
Version | License | PHP version | Categories | |||
php2pdfgraphcompare 1.1 | GNU General Publi... | 4 | Graphics, Files and Folders, Printing |
Description | Author | |||
This class can generate line charts to compare data in PDF. Innovation Award
|
PHP2PDFGraphCompare is a PHP class that create PDF file with line graph comparatives like google analytics. FPDF class extended
$pdf = new PDF( '$p_orient', 'mm', '$p_size' );
$pdf->Open();
$pdf->AddPage();
// define position and dimentions
$x = 15;
$y = 30;
$w = ($pdf->w - 20);
$h = 80;
// define title
$repTitle = "Visits";
$arrData = array();
// define old data
$arrData[] = array(
"title" => "Last Month",
"color" => array(55,00,122),
"data" => array(
array(
"key" => 1,
"value" => 800
),
array(
"key" => 2,
"value" => 3100
),
array(
"key" => 3,
"value" => 2700
),
array(
"key" => 4,
"value" => 2100
),
array(
"key" => 5,
"value" => 2000
),
array(
"key" => 6,
"value" => 2700
),
array(
"key" => 7,
"value" => 3000
),
array(
"key" => 8,
"value" => 3600
),
array(
"key" => 9,
"value" => 3250
),
array(
"key" => 10,
"value" => 3150
),
)
);
// define current data
$arrData[] = array(
"title" => "Current",
"color" => array(237,125,22),
"data" => array(
array(
"key" => 1,
"value" => 1800
),
array(
"key" => 2,
"value" => 2900
),
array(
"key" => 3,
"value" => 3700
),
array(
"key" => 4,
"value" => 3100
),
array(
"key" => 5,
"value" => 4100
),
array(
"key" => 6,
"value" => 3800
),
array(
"key" => 7,
"value" => 3900
),
array(
"key" => 8,
"value" => 3600
),
array(
"key" => 9,
"value" => 3800
),
array(
"key" => 10,
"value" => 3750
),
)
);
// gen line charts
$pdf->LineChart($x,$y,$w,$h,$repTitle,$arrData);
// gen pdf file
$pdf->Output();
Screenshots | ||
Files |
File | Role | Description | ||
---|---|---|---|---|
font (4 files) | ||||
composer.json | Data | Auxiliary data | ||
example.pdf | Data | Auxiliary data | ||
example.php | Example | Example script | ||
example.png | Output | Example | ||
fpdf.php | Class | Class source | ||
PHP2PDFGraphCompare.php | Class | Class source | ||
README.md | Doc. | Documentation |
Files | / | font |
File | Role | Description |
---|---|---|
helvetica.php | Aux. | Auxiliary script |
helveticab.php | Aux. | Auxiliary script |
helveticabi.php | Aux. | Auxiliary script |
helveticai.php | Aux. | Auxiliary script |
php2pdfgraphcompare-2016-06-09.zip 120KB | |
php2pdfgraphcompare-2016-06-09.tar.gz 117KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
91% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.