Ejemplo n.º 1
0
 /**
  * @expectedException \ByJG\AnyDataset\Exception\DatasetException
  */
 function test_serverNotFound()
 {
     $txtFile = new TextFileDataset("http://notfound-test/alalal", self::$fieldNames, TextFileDataset::CSVFILE);
     $txtIterator = $txtFile->getIterator();
 }
Ejemplo n.º 2
0
 protected function Opcao9()
 {
     $block = new XmlBlockCollection("Exemplo 9: XmlChart", BlockPosition::Center);
     //XmlnukeBreakLine br = new XmlnukeBreakLine();
     $para1 = new XmlParagraphCollection();
     $colNodeStr = array();
     $colNodeStr[] = "category";
     $colNodeStr[] = "title";
     $colNodeStr[] = "titlelang";
     $colNodeStr[] = "year";
     $colNodeStr[] = "price";
     $colNodeStr[] = "buyprice";
     $colNodeStr[] = "author";
     $processor = new AnydatasetFilenameProcessor("sample");
     $dataset = new TextFileDataset($processor->PathSuggested() . "sample.csv", $colNodeStr);
     //$para1->addXmlnukeObject(new XmlnukeText(""));
     $editlist = new XmlEditList($this->_context, "Text Flat", $this->_url . "?op=9");
     $editlist->setReadOnly(true);
     $editlist->setDataSource($dataset->getIterator());
     $para1->addXmlnukeObject($editlist);
     $chart = new XmlChart($this->_context, "Book Store", $dataset->getIterator(), ChartOutput::Flash, ChartSeriesFormat::Column);
     $chart->setLegend("category", "#000000", "#C0C0C0");
     $chart->addSeries("price", "Sell Price", "#000000");
     $chart->addSeries("buyprice", "Buy Price", "#000000");
     $para1->addXmlnukeObject($chart);
     $code = new XmlnukeCode("Code Sample");
     $code->AddTextLine("\$chart = new XmlChart(");
     $code->AddTextLine("\t\t\$this->_context,             // Xmlnuke Context");
     $code->AddTextLine("\t\t\"Book Store\",            // Graph Title");
     $code->AddTextLine("\t\t\$dataset->getIterator(),     // IteratorInterface Object");
     $code->AddTextLine("\t\tChartOutput::Flash,         // Graph output format ");
     $code->AddTextLine("\t\tChartSeriesFormat::Column   // Default column type");
     $code->AddTextLine(");");
     $code->AddTextLine("\$chart->setLegend(\"category\", \"#000000\", \"#C0C0C0\");");
     $code->AddTextLine("\$chart->addSeries(\"price\", \"Sell Price\", \"#000000\");");
     $para1->addXmlnukeObject($code);
     $block->addXmlnukeObject($para1);
     $this->_document->addXmlnukeObject($block);
 }