$lineChart->addBackgroundFill('c', '000000');<br> </code> </p> <h2>Line Chart with Strip Fill</h2> <?php $lineChart = new gLineChart(300, 300); $lineChart->addDataSet(array(112, 315, 66, 40)); $lineChart->addDataSet(array(212, 115, 366, 140)); $lineChart->addDataSet(array(112, 95, 116, 140)); $lineChart->setLegend(array("first", "second", "third", "fourth")); $lineChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa")); $lineChart->setVisibleAxes(array('x', 'y')); $lineChart->setDataRange(30, 400); $lineChart->addAxisLabel(0, array("This", "axis", "has", "labels!")); $lineChart->addAxisRange(1, 30, 400); $lineChart->setStripFill('bg', 0, array('CCCCCC', 0.15, 'FFFFFF', 0.1)); ?> <img src="<?php print $lineChart->getUrl(); ?> " /> <br> line chart using the gLineChart class. <p> <em>code:</em><br> <code> $lineChart = new gLineChart(300,300);<br> $lineChart->addDataSet(array(112,315,66,40));<br> $lineChart->addDataSet(array(212,115,366,140));<br> $lineChart->addDataSet(array(112,95,116,140));<br> $lineChart->setLegend(array("first", "second", "third","fourth"));<br> $lineChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa"));<br> $lineChart->setVisibleAxes(array('x','y'));<br>
function test_LineChart_StripFill() { $lineChart = new gLineChart(300, 300); $lineChart->addDataSet(array(112, 315, 66, 40)); $lineChart->addDataSet(array(212, 115, 366, 140)); $lineChart->addDataSet(array(112, 95, 116, 140)); $lineChart->setLegend(array("first", "second", "third", "fourth")); $lineChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa")); $lineChart->setVisibleAxes(array('x', 'y')); $lineChart->setDataRange(30, 400); $lineChart->addAxisLabel(0, array("This", "axis", "has", "labels!")); $lineChart->addAxisRange(1, 30, 400); $lineChart->setStripFill('bg', 0, array('CCCCCC', 0.15, 'FFFFFF', 0.1)); $text = <<<END newLineChart: 300,300 addDataSet: 112,315,66,40 addDataSet: 212,115,366,140 addDataSet: 112,95,116,140 setLegend: first, second, third, fourth setColors: ff3344, 11ff11, 22aacc, 3333aa setVisibleAxes: x, y setDataRange: 30, 400 addAxisLabel: 0, Labels: This, axis, has, labels! addAxisRange: 1, 30, 400 setStripFill: bg, 0, Colors: CCCCCC, 0.15, FFFFFF ,0.1 END; $parser = new gChartPhpDSLParser(); $parser->parse($text); $this->assertEqual($lineChart->getUrl(), $parser->getUrl()); }