<?php include( 'chartlogix.inc.php' ); // This is an example of using the addDataToSeries function $chart = new BarChart(); // Create all the series first $chart->doBarSeries( 'Sales', '00FF00' ); $chart->doStackedBarSeries( 'Purchases', 'FF0000' ); // Now add data to each column // addDataToSeries( series name, column name, data value ) $chart->addDataToSeries( 'Sales', 'Jan', 750 ); $chart->addDataToSeries( 'Purchases', 'Jan', 270 ); $chart->addDataToSeries( 'Sales', 'Feb', 250 ); $chart->addDataToSeries( 'Purchases', 'Feb', 630 ); $chart->addDataToSeries( 'Sales', 'Mar', 710 ); $chart->addDataToSeries( 'Purchases', 'Mar', 510 ); $chart->addDataToSeries( 'Sales', 'Apr', 400 ); $chart->addDataToSeries( 'Purchases', 'Apr', 230 ); $chart->addDataToSeries( 'Sales', 'May', 690 ); $chart->addDataToSeries( 'Purchases', 'May', 180 ); // Output the image $chart->drawPNG( 500, 400 );
|