[42] | 1 | <?php |
---|
| 2 | require_once ('jpgraph/jpgraph.php'); |
---|
| 3 | require_once ('jpgraph/jpgraph_matrix.php'); |
---|
| 4 | |
---|
| 5 | $data = array( |
---|
| 6 | array(0,1,2,3,4,5,6,7,8,9,10), |
---|
| 7 | array(10,9,8,7,6,5,4,3,2,1,0), |
---|
| 8 | array(0,1,2,3,4,5,6,7,8,9,10), |
---|
| 9 | array(10,9,8,17,6,5,4,3,2,1,0), |
---|
| 10 | array(0,1,2,3,4,4,9,7,8,9,10), |
---|
| 11 | array(8,1,2,3,4,8,3,7,8,9,10), |
---|
| 12 | array(10,3,5,7,6,5,4,3,12,1,0), |
---|
| 13 | array(10,9,8,7,6,5,4,3,2,1,0), |
---|
| 14 | ); |
---|
| 15 | |
---|
| 16 | $width=400; $height=350; |
---|
| 17 | $graph = new MatrixGraph($width,$height); |
---|
| 18 | $graph->title->Set('Using a circular module type'); |
---|
| 19 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,14); |
---|
| 20 | |
---|
| 21 | $mp = new MatrixPlot($data,2); |
---|
| 22 | $mp->SetSize(0.85); |
---|
| 23 | $mp->SetModuleType(1); |
---|
| 24 | $mp->SetBackgroundColor('teal:1.8'); |
---|
| 25 | $mp->SetCenterPos(0.5,0.45); |
---|
| 26 | $mp->SetLegendLayout(1); |
---|
| 27 | |
---|
| 28 | $graph->Add($mp); |
---|
| 29 | $graph->Stroke(); |
---|
| 30 | |
---|
| 31 | ?> |
---|