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


function markCallback($y,$x) {
    // Return array width
    // width,color,fill color, marker filename, imgscale
    // any value can be false, in that case the default value will
    // be used.
    // We only make one pushpin another color
    if( $x == 54 ) 
	return array(false,false,false,'red',0.8);
	return array(false,false,false,'green',0.8);

// Data arrays
$datax = array(10,20,30,40,54,60,70,80);
$datay = array(12,23,65,18,84,28,86,44);

// Setup the graph
$graph = new Graph(400,270);

// We add a small 1pixel left,right,bottom margin so the plot area
// doesn't cover the frame around the graph.

// We don't want any axis to be shown

// Use a worldmap as the background and let it fill the plot area

// Setup a nice title with a striped bevel background
$graph->title->Set("Pushpin graph");

// Finally create the scatterplot
$sp = new ScatterPlot($datay,$datax);

// We want the markers to be an image

// Install the Y-X callback for the markers

// ...  and add it to the graph

// .. and output to browser


Return current item: Monyet