Source for file XMLFormat.php
Documentation is available at XMLFormat.php
* Description: Chart data export to XML
* @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
* @link http://www.steema.com
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
return "XMLFilter"; // TODO $this->Language->getString("XMLFilter");
private function get($aList, $index) {
return " " . $aList->getName() . "=\"" . (string) ($aList->getValue($index)) .
private function getPointString($index, $aSeries) {
"index=\"" . (string) ($index) . "\"" :
// the point Label text, if exists
$labels= $aSeries->getLabels();
$tmpResult->append(" text=\"" . $labels[$index] .
// the "X" point value, if exists
$tmpResult->append($this->get($aSeries->getNotMandatory(), $index));
$tmpResult->append($this->get($aSeries->getMandatory(), $index));
// write the rest of values (always)
for ( $tt = 2; $tt < sizeof($aSeries->getValuesLists()); $tt++ ) {
$tmpResult->append($this->get($aSeries->getValueList($tt), $index));
return $tmpResult->toString();
private function seriesPoints($aSeries) {
if ($aSeries->getCount() > 0) {
for ( $t = 0; $t < $aSeries->getCount(); $t++ ) {
$tmpResult->append("<point " . $this->getPointString($t, $aSeries) . "/>" .
return $tmpResult->toString();
private function XMLSeries($aSeries) {
"<series title=\"" . $aSeries->toString() . "\" type=\"" .
"<points count=\"" . (string) ($aSeries->getCount()) .
$this->seriesPoints($aSeries) .
$tmpResult->append($this->XMLSeries($this->series));
for ( $t = 0; $t < $this->chart->getSeriesCount(); $t++ ) {
$s = $this->chart->getSeries($t);
$tmpResult->append($this->XMLSeries($s));
$tmpResult->append("</chart>");
return $tmpResult->toString();
|