- Timestamp:
- 06/27/08 15:53:43 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/job_monarch/chart.php
r527 r528 22 22 } 23 23 24 #print_r( $values ); 25 #print_r( $legend ); 26 27 // Standard inclusions 24 // Include pChart libs 25 // 28 26 include("./lib/pchart/pData.class"); 29 27 include("./lib/pchart/pChart.class"); 30 28 31 // Dataset definition 29 // Dataset definition 30 // 32 31 $DataSet = new pData; 33 $DataSet->AddPoint( $values,"Serie1");34 $DataSet->AddPoint( $legend,"Serie2");32 $DataSet->AddPoint( $values, "Pie slices" ); 33 $DataSet->AddPoint( $legend, "Legend" ); 35 34 $DataSet->AddAllSeries(); 36 $DataSet->SetAbsciseLabelSerie( "Serie2");35 $DataSet->SetAbsciseLabelSerie( "Legend" ); 37 36 38 37 // Initialise the graph 39 $ Test = new pChart(380,200);40 $ Test->drawFilledRoundedRectangle(7,7,373,193,5,240,240,240);41 $ Test->drawRoundedRectangle(5,5,375,195,5,230,230,230);38 $myChart = new pChart(380,200); 39 $myChart->drawFilledRoundedRectangle(7,7,373,193,5,240,240,240); 40 $myChart->drawRoundedRectangle(5,5,375,195,5,230,230,230); 42 41 43 // Draw the pie chart 44 $Test->setFontProperties("./lib/pchart/tahoma.ttf",8); 45 $Test->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,90,110,TRUE,TRUE,50,20,20); 46 $Test->drawPieLegend(310,15,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250); 42 // Font for slice percentages & legend text 43 // 44 $myChart->setFontProperties( "./lib/pchart/tahoma.ttf", 8 ); 47 45 48 $Test->drawTitle(60,22,$title,50,50,50,585); 46 // Draw the pie slices and percentages text 47 // 48 $myChart->drawPieGraph( $DataSet->GetData(), $DataSet->GetDataDescription(), 150, 90, 110, TRUE, TRUE, 50, 20, 20 ); 49 49 50 $Test->Stroke(); 50 // Draw legend text 51 // 52 $myChart->drawPieLegend( 280, 15, $DataSet->GetData(), $DataSet->GetDataDescription(), 250, 250, 250 ); 53 54 // Font for title: a little bigger 55 // 56 $myChart->setFontProperties( "./lib/pchart/tahoma.ttf", 12 ); 57 58 // Draw title text 59 // 60 $myChart->drawTitle( 0, 5, $title, 50, 50, 50, 380, 20 ); 61 62 // Draw complete graph embedded inline: output the png 63 // 64 $myChart->Stroke(); 51 65 ?>
Note: See TracChangeset
for help on using the changeset viewer.