This is the code for a simple bargraph with comments
what each line does.
 // Storing the data in an array makes it easy to loop through
 // when adding later, but it can also be added one value
 // at a time
 $data = Array(10,20,30,40,50,40,30,20,10,0,-10,-20,-10,0,10,20);
 // Next, create a new instance of Sparkline_Bar
 $graph = new Sparkline_Bar();
 // Set the width of each bar in the graph
 // Set the spacing between the bars
 // Add a color called "mygray" to the available color list
 $graph->setColorHtml("mygray", "#424542");
 // Set the background color to this new color
 // As of 0.2, if you didn't set the color beforehand,
 // your background would be black
 // Begin the loop to add the data
 foreach ($data as $key => $value) {
 // Add the data
 // This will make one white bar with the relative value
 // of $value
 $graph->setData($key, $value, 'white');
 // Draw all necessary objects for our graph
 // The height will be 16
 // Displays the graph by sending a 'Content-type: image/png'
 // header then outputting the image data
 echo $graph->output();