Ejemplo n.º 1
0
 private function setValuesIfThereIsSomeToThisYear($value, $seriesName, $axis)
 {
     if (!is_null($value)) {
         $this->xml->setValue($value->getValue(), $seriesName);
     } else {
         $this->xml->setValue(0, $seriesName);
     }
     if ($axis) {
         $this->xml->setLineToAnAxis($seriesName, "S");
     }
 }
<?php

require_once '../asserts/Asserts.php';
require_once '../../core/Charts/XmlCharts/XmlChart.php';
require_once '../../core/Charts/XmlCharts/MultiSerie/XmlMultiSeries.php';
require_once '../../core/Charts/XmlCharts/MultiSerie/XmlMultiSeriesCombinationColumnLine.php';
$xmlExpected = xml();
$xmlTest = "test";
$xml = new XmlMultiSeriesCombinationColumnLine();
$xml->addChartAttribute("caption", "Product Sales and Downloads");
$xml->addChartAttribute("showValues", "0");
$xml->setPYAxisName("Sales");
$xml->setSYAxisName("Total Downloads");
$xml->addCategory("Jan");
$xml->addCategory("Fev");
$xml->addCategory("Mar");
$xml->addCategory("Abr");
$xml->newDataset("2006");
$xml->setValues(new ArrayObject(array("27400", "29800", "25800", "20580")), "2006");
$xml->setValues(new ArrayObject(array("10000", "11500", "12500", "13000")), "2005");
$xml->setValues(new ArrayObject(array("12000", "13000", "11000", "9500")), "2004");
$xml->setLineToAnAxis("2005", "S");
$xml->setLineToAnAxis("2004", "S");
$xmlFile = "text.xml";
assertEquals(formatGreaterAndSmallerSymbols($xml->buildXml($xmlFile)), $xmlExpected);
?>

<?
    function xml(){
        return formatGreaterAndSmallerSymbols(chart());   
    }