Location: PHPKode > projects > Monyet > plotter/jpgraph-2.2/src/Examples/horizbarex1.php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");


// Size of graph

// Set the basic parameters of the graph 
$graph = new Graph($width,$height,'auto');

// Rotate graph 90 degrees and set margin

// Nice shadow

// Setup title
$graph->title->Set("Horizontal bar graph ex 1");
$graph->subtitle->Set("(No Y-axis)");

// Setup X-axis

// Some extra margin looks nicer

// Label align for X-axis

// Add some grace to y-axis so the bars doesn't go
// all the way to the end of the plot area

// We don't want to display Y-axis

// Now create a bar pot
$bplot = new BarPlot($datay);

//You can change the width of the bars if you like

// We want to display the value of each bar at the top
$bplot->value->SetFormat('%.1f mkr');

// Add the bar to the graph

// .. and stroke the graph
Return current item: Monyet