php - PHPGraphLib scientific notation Issue
I am using this graphing library to generate a few basic graphs. The issue I am having is that is cases where the values for the Y axis are over a million, The graph renders the numbers in scientific notation.
I'm not sure if this is a PHP issue or something within the library. I have looked through the source code but haven't been able to resolve the issue.
Here is a code example:
<?php include('phpgraphlib.php'); include('phpgraphlib_stacked.php'); $graph = new PHPGraphLibStacked(500,300); $popularity = array('Windows 7'=>8000000, 'Mac OS 10'=>3500000, 'Fedora'=>900000); $cost = array('Windows 7'=>1000000, 'Mac OS 10'=>3000000, 'Fedora'=>9000000); $speed = array('Windows 7'=>5000000,'Mac OS 10'=>5000000,'Fedora'=>8000000); $graph->addData($popularity, $cost, $speed); $graph->setTitle('Operating System Scores'); $graph->setTitleLocation('left'); $graph->setXValuesHorizontal(TRUE); $graph->setTextColor('blue'); $graph->setBarColor('#0066CC', '#669999', '#66CCCC'); $graph->setLegend(TRUE); $graph->setLegendTitle('Popularity', 'Cost', 'Speed'); $graph->setDataFormat('comma'); $graph->setupYAxis(20); $graph->createGraph(); ?>
Here is the source of this library: