Ejemplo n.º 1
0
 public function setUp()
 {
     $data = array();
     for ($i = 1; $i <= 10; $i++) {
         $data[] = $i;
     }
     $jsWriterMethods = array('initializeSeries', 'setShadow', 'setFill', 'useSeriesLabels', 'setSeriesLabelSetting', 'setSeriesOption', 'getSeriesOption', 'getOptionsForSeries', 'setSeriesLineWidth', 'setSeriesShowLine', 'setSeriesShowMarker', 'setSeriesMarkerStyle', 'setSeriesMarkerSize', 'setType');
     $mockChart = $this->getMock('\\Altamira\\Chart', array(), array('mockChart'));
     $this->data = TwoDimensionalPointFactory::getFromXValues($data);
     $this->mockJqPlotWriter = $this->getMock('\\Altamira\\JsWriter\\JqPlot', $jsWriterMethods, array($mockChart));
     $this->mockFlotWriter = $this->getMock('\\Altamira\\JsWriter\\JqPlot', $jsWriterMethods, array($mockChart));
     $this->jqPlotSeries = new Series($this->data, 'jqPlot', $this->mockJqPlotWriter);
     $this->flotSeries = new Series($this->data, 'Flot', $this->mockFlotWriter);
 }
 private function sampleChartGenerator($library = null)
 {
     $chartsFactory = $this->get('charts_factory');
     if (!is_null($library)) {
         $chartsFactory->setLibrary($library);
     }
     $charts = array();
     for ($i = 1; $i <= 8; $i++) {
         $charts[] = $chartsFactory->createChart('chart' . $i);
     }
     $series1Points = TwoDimensionalPointFactory::getFromYValues(array(2, 8, 5, 3, 8, 9, 7, 8, 4, 2, 1, 6));
     $series2Points = TwoDimensionalPointFactory::getFromYValues(array(7, 3, 7, 8, 2, 3, 1, 2, 5, 7, 8, 3));
     $charts[0]->addSeries($charts[0]->createSeries($series1Points, 'Sales'))->addSeries($charts[0]->createSeries($series2Points, 'Returns'))->setTitle('Basic Line Chart')->setAxisOptions('y', 'formatString', '$%d')->setAxisOptions('x', 'tickInterval', 1)->setAxisOptions('x', 'min', 0)->setLegend(array('on' => true))->setAxisOptions('x', 'min', 0)->setAxisOptions('x', 'max', 14)->setAxisOptions('y', 'min', 0)->setAxisOptions('y', 'max', 10);
     $seriesPoints = TwoDimensionalPointFactory::getFromNested(array(array('1/4/1990', 850), array('2/27/1991', 427), array('1/6/1994', 990), array('8/6/1994', 127), array('12/25/1995', 325)));
     $series = $charts[1]->createSeries($seriesPoints, 'Measured Readings');
     $series->useLabels(array('a', 'b', 'c', 'd', 'e'))->setLabelSetting('location', 'w')->setLabelSetting('xpadding', 8)->setLabelSetting('ypadding', 8);
     $charts[1]->addSeries($series)->setTitle('Line Chart With Highlights and Labels')->useDates()->useHighlighting();
     $seriesA = $charts[2]->createSeries(TwoDimensionalPointFactory::getFromYValues(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), 'First');
     $seriesB = $charts[2]->createSeries(TwoDimensionalPointFactory::getFromYValues(array(1, 10, 2, 9, 3, 8, 4, 7, 5, 6)), 'Second');
     $seriesC = $charts[2]->createSeries(TwoDimensionalPointFactory::getFromYValues(array(10, 7, 6, 5, 3, 1, 3, 5, 6, 7)), 'Third');
     $seriesA->showMarker(false)->setLineWidth(8);
     $seriesB->setMarkerStyle('filledSquare')->showLine(false);
     $seriesC->setLineWidth(1)->setMarkerSize(15)->setMarkerStyle('diamond');
     $charts[2]->setTitle('Line Chart With Custom Formats And Zoom (drag to zoom, double-click to reset)')->addSeries($seriesA)->addSeries($seriesB)->addSeries($seriesC)->useZooming()->setAxisOptions('x', 'min', 0)->setAxisOptions('x', 'max', 12)->setAxisOptions('y', 'min', 0)->setAxisOptions('y', 'max', 12);
     $charts[3]->setTitle('Horizontal Bar Chart')->addSeries($charts[3]->createSeries(TwoDimensionalPointFactory::getFromXValues(array(1, 4, 8, 2, 1, 5)), 'Runs'))->addSeries($charts[3]->createSeries(TwoDimensionalPointFactory::getFromXValues(array(3, 3, 5, 4, 2, 6)), 'Walks'))->setType('Bar', array('horizontal' => true))->setAxisTicks('y', array('1st Inning', '2nd Inning', '3rd Inning', '4th Inning', '5th Inning', '6th Inning'))->setLegend(array('on' => true, 'location' => 'se', 'x' => 5, 'y' => 5));
     $manySeriesArray = array(array('Pots', 7), array('Pans', 5), array('Spoons', 2), array('Knives', 5), array('Forks', 12));
     $nestedFactoryMethod = array('Altamira\\ChartDatum\\TwoDimensionalPointFactory', 'getFromNested');
     $charts[4]->setTitle('Pie Chart')->addSeries($charts[4]->createManySeries($manySeriesArray, $nestedFactoryMethod, 'Utensils'))->setType('Pie')->setLegend();
     $chart6Many1 = array(array('Metals', 3), array('Plastics', 5), array('Wood', 2), array('Glass', 7), array('Paper', 9));
     $chart6Many2 = array(array('Metals', 4), array('Plastics', 2), array('Wood', 5), array('Glass', 4), array('Paper', 12));
     $charts[5]->setTitle('Donut Chart With Custom Colors And Labels')->setSeriesColors(array('#dd3333', '#d465f1', '#aa2211', '#3377aa', '#6699bb', '#9933aa'))->setType('Donut', array('sliceMargin' => 3, 'showDataLabels' => true))->setLegend();
     if ($library == \Altamira\JsWriter\Flot::LIBRARY) {
         $charts[5]->addSeries($charts[5]->createManySeries($chart6Many1, $nestedFactoryMethod, 'Internal'));
         // Flot doesn't support inner and outer, but you can always use extra js to superimpose
         $charts[] = $chartsFactory->createChart('chart' . $i);
         $charts[8]->addSeries($charts[8]->createManySeries($chart6Many2, $nestedFactoryMethod, 'External'))->setTitle('Donut Chart With Custom Colors And Labels')->setSeriesColors(array('#dd3333', '#d465f1', '#aa2211', '#3377aa', '#6699bb', '#9933aa'))->setType('Donut', array('sliceMargin' => 3, 'showDataLabels' => true))->setLegend();
     } else {
         $charts[5]->addSeries($charts[5]->createManySeries($chart6Many1, $nestedFactoryMethod, 'Internal'))->addSeries($charts[5]->createManySeries($chart6Many2, $nestedFactoryMethod, 'External'));
     }
     $bubbleFactoryMethod = array('Altamira\\ChartDatum\\BubbleFactory', 'getBubbleDatumFromTupleSet');
     $charts[6]->addSeries($charts[6]->createManySeries(array(array('Screws', 4, 7, 5), array('Nails', 5, 3, 6), array('Bolts', 4, 5, 7), array('Nuts', 3.5, 4, 6), array('Washers', 3, 2, 5), array('Pliers', 4, 1, 5), array('Hammers', 4.5, 6, 6)), $bubbleFactoryMethod, 'Bubble'))->setTitle('Bubble Chart')->setType('Bubble', array('bubbleAlpha' => 0.5, 'highlightAlpha' => 0.7))->setAxisOptions('x', 'min', 2)->setAxisOptions('x', 'max', 6)->setAxisOptions('y', 'min', -2)->setAxisOptions('y', 'max', 10);
     $array1 = array(1, 4, 8, 2, 1, 5);
     $array2 = array(3, 3, 5, 4, 2, 6);
     $num = max(count($array1), count($array2));
     for ($i = 0; $i < $num; $i++) {
         $total = $array1[$i] + $array2[$i];
         $array1[$i] = $array1[$i] / $total * 100;
         $array2[$i] = $array2[$i] / $total * 100;
     }
     $charts[7]->setTitle('Vertical Stack Chart')->addSeries($charts[7]->createSeries(TwoDimensionalPointFactory::getFromYValues($array1), 'Is'))->addSeries($charts[7]->createSeries(TwoDimensionalPointFactory::getFromYValues($array2), 'Is Not'))->setType('Bar', array('stackSeries' => true))->setLegend(array('on' => true, 'location' => 'se', 'x' => 5, 'y' => 5))->setAxisOptions('y', 'max', 100);
     if ($library == \Altamira\JsWriter\JqPlot::LIBRARY) {
         foreach ($charts[7]->getSeries() as $series) {
             $series->useLabels();
         }
     }
     $chartIterator = $chartsFactory->getChartIterator($charts);
     $altamiraJSLibraries = $chartIterator->getLibraries();
     $altamiraCSS = $chartIterator->getCSSPath();
     $altamiraJSScript = $chartIterator->getScripts();
     $altamiraPlugins = $chartIterator->getPlugins();
     while ($chartIterator->valid()) {
         $altamiraCharts[] = $chartIterator->current()->getDiv();
         $chartIterator->next();
     }
     //print_r($charts);
     return $this->render('MalwarebytesAltamiraBundle:Default:example.html.twig', array('altamiraJSLibraries' => $altamiraJSLibraries, 'altamiraCSS' => $altamiraCSS, 'altamiraScripts' => $altamiraJSScript, 'altamiraCharts' => $altamiraCharts, 'altamiraJSPlugins' => $altamiraPlugins));
 }
Ejemplo n.º 3
0
$seriesPoints = TwoDimensionalPointFactory::getFromNested(array(array('1/4/1990', 850), array('2/27/1991', 427), array('1/6/1994', 990), array('8/6/1994', 127), array('12/25/1995', 325)));
$chart2 = new Chart('chart2', $library);
$series = $chart2->createSeries($seriesPoints, 'Measured Readings');
$series->useLabels(array('a', 'b', 'c', 'd', 'e'))->setLabelSetting('location', 'w')->setLabelSetting('xpadding', 8)->setLabelSetting('ypadding', 8);
$chart2->setTitle('Line Chart With Highlights and Labels')->addSeries($series)->useDates()->useHighlighting();
$chart3 = new Chart('chart3', $library);
$seriesA = $chart3->createSeries(TwoDimensionalPointFactory::getFromYValues(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), 'First');
$seriesB = $chart3->createSeries(TwoDimensionalPointFactory::getFromYValues(array(1, 10, 2, 9, 3, 8, 4, 7, 5, 6)), 'Second');
$seriesC = $chart3->createSeries(TwoDimensionalPointFactory::getFromYValues(array(10, 7, 6, 5, 3, 1, 3, 5, 6, 7)), 'Third');
// These styles are only supported by Flot
$seriesA->showMarker(false)->setLineWidth(8);
$seriesB->setMarkerStyle('filledSquare')->showLine(false);
$seriesC->setLineWidth(1)->setMarkerSize(15)->setMarkerStyle('diamond');
$chart3->setTitle('Line Chart With Custom Formats And Zoom (drag to zoom, double-click to reset)')->addSeries($seriesA)->addSeries($seriesB)->addSeries($seriesC)->useZooming()->setAxisOptions('x', 'min', 0)->setAxisOptions('x', 'max', 12)->setAxisOptions('y', 'min', 0)->setAxisOptions('y', 'max', 12);
$chart4 = new Chart('chart4', $library);
$chart4->setTitle('Horizontal Bar Chart')->addSeries($chart4->createSeries(TwoDimensionalPointFactory::getFromXValues(array(1, 4, 8, 2, 1, 5)), 'Runs'))->addSeries($chart4->createSeries(TwoDimensionalPointFactory::getFromXValues(array(3, 3, 5, 4, 2, 6)), 'Walks'))->setType('Bar', array('horizontal' => true))->setAxisTicks('y', array('1st Inning', '2nd Inning', '3rd Inning', '4th Inning', '5th Inning', '6th Inning'))->setLegend(array('on' => true, 'location' => 'se', 'x' => 5, 'y' => 5));
$manySeriesArray = array(array('Pots', 7), array('Pans', 5), array('Spoons', 2), array('Knives', 5), array('Forks', 12));
$nestedFactoryMethod = array('Altamira\\ChartDatum\\TwoDimensionalPointFactory', 'getFromNested');
$chart5 = new Chart('chart5', $library);
$chart5->setTitle('Pie Chart')->addSeries($chart5->createManySeries($manySeriesArray, $nestedFactoryMethod, 'Utensils'))->setType('Pie')->setLegend();
$chart6Many1 = array(array('Metals', 3), array('Plastics', 5), array('Wood', 2), array('Glass', 7), array('Paper', 9));
$chart6Many2 = array(array('Metals', 4), array('Plastics', 2), array('Wood', 5), array('Glass', 4), array('Paper', 12));
$chart6 = new Chart('chart6', $library);
$chart6->setTitle('Donut Chart With Custom Colors And Labels')->setSeriesColors(array('#dd3333', '#d465f1', '#aa2211', '#3377aa', '#6699bb', '#9933aa'))->setType('Donut', array('sliceMargin' => 3, 'showDataLabels' => true))->setLegend();
if ($library == \Altamira\JsWriter\Flot::LIBRARY) {
    $chart6->addSeries($chart6->createManySeries($chart6Many1, $nestedFactoryMethod, 'Internal'));
    // Flot doesn't support inner and outer, but you can always use extra js to superimpose
    $chart6a = new Chart('chart6a', $library);
    $chart6a->addSeries($chart6->createManySeries($chart6Many2, $nestedFactoryMethod, 'External'))->setTitle('Donut Chart With Custom Colors And Labels')->setSeriesColors(array('#dd3333', '#d465f1', '#aa2211', '#3377aa', '#6699bb', '#9933aa'))->setType('Donut', array('sliceMargin' => 3, 'showDataLabels' => true))->setLegend();
} else {
    $chart6->addSeries($chart6->createManySeries($chart6Many1, $nestedFactoryMethod, 'Internal'))->addSeries($chart6->createManySeries($chart6Many2, $nestedFactoryMethod, 'External'));
Ejemplo n.º 4
0
 /**
  * @covers \Altamira\ChartDatum\TwoDimensionalPointFactory::getFromYValues
  * @covers \Altamira\ChartDatum\TwoDimensionalPointFactory::getFromXValues
  * @covers \Altamira\ChartDatum\TwoDimensionalPointFactory::getFromNested
  * @covers \Altamira\ChartDatum\BubbleFactory::getBubbleDatumFromTupleSet
  */
 public function testFactories()
 {
     $values = array(0 => 1, 1 => 2, 2 => 3);
     $allValues = \Altamira\ChartDatum\TwoDimensionalPointFactory::getFromYValues($values);
     $yvaluePoints = $allValues;
     $allValues = \Altamira\ChartDatum\TwoDimensionalPointFactory::getFromXValues($values, $allValues);
     $xvaluePoints = array_slice($allValues, 0, count($yvaluePoints));
     foreach ($values as $key => $value) {
         $chartDatumX = array_shift($xvaluePoints);
         $chartDatumY = array_shift($yvaluePoints);
         $this->assertInstanceOf('\\Altamira\\ChartDatum\\TwoDimensionalPoint', $chartDatumY, '\\Altamira\\ChartDatum\\TwoDimensionalPointFactory::getFromYValues should return an array of chartdatum instances when not provided an array to append to');
         $this->assertEquals($value, $chartDatumY['y']);
         $this->assertEquals($key + 1, $chartDatumY['x'], '\\Altamira\\ChartDatum\\TwoDimensionalPointFactory::getFromYValues should set the X value as one greater than the source data\'s array index');
         $this->assertEquals($key + 1, $chartDatumX['y'], '\\Altamira\\ChartDatum\\TwoDimensionalPointFactory::getFromXValues should set the X value as one greater than the source data\'s array index');
         $this->assertEquals($value, $chartDatumX['x']);
     }
     $nestedData = array(array(0, 5), array(1, 1), array(1, 2));
     $nestedPoints = \Altamira\ChartDatum\TwoDimensionalPointFactory::getFromNested($nestedData);
     foreach ($nestedPoints as $nestedPoint) {
         $nestedVal = array_shift($nestedData);
         $this->assertEquals($nestedVal[0], $nestedPoint['x']);
         $this->assertEquals($nestedVal[1], $nestedPoint['y']);
     }
     $tupleSet = array(array('foo', 2, 3, 4), array('bar', 3, 4, 5));
     $bubblePoints = \Altamira\ChartDatum\BubbleFactory::getBubbleDatumFromTupleSet($tupleSet);
     foreach ($bubblePoints as $bubble) {
         $tuple = array_shift($tupleSet);
         $this->assertEquals($tuple[0], $bubble->getLabel());
         $this->assertEquals($tuple[1], $bubble['x']);
         $this->assertEquals($tuple[2], $bubble['y']);
         $this->assertEquals($tuple[3], $bubble['radius']);
     }
 }
Ejemplo n.º 5
0
 /**
  * @covers \Altamira\Chart::__construct
  * @covers \Altamira\Chart::getJsWriter
  * @covers \Altamira\Chart::getName
  * @covers \Altamira\Chart::getTitle
  * @covers \Altamira\Chart::setTitle
  * @covers \Altamira\Chart::useHighlighting
  * @covers \Altamira\Chart::useZooming
  * @covers \Altamira\Chart::useCursor
  * @covers \Altamira\Chart::useDates
  * @covers \Altamira\Chart::setAxisTicks
  * @covers \Altamira\Chart::setAxisOptions
  * @covers \Altamira\Chart::setSeriesColors
  * @covers \Altamira\Chart::setAxisLabel
  * @covers \Altamira\Chart::setType
  * @covers \Altamira\Chart::setTypeOption
  * @covers \Altamira\Chart::setLegend
  * @covers \Altamira\Chart::setGrid
  * @covers \Altamira\Chart::getFiles
  * @covers \Altamira\Chart::getScript
  * @covers \Altamira\Chart::getJsWriter
  * @covers \Altamira\Chart::getLibrary
  * @covers \Altamira\Chart::getSeries
  * @covers \Altamira\Chart::addSeries
  * @covers \Altamira\Chart::addSingleSeries
  * @covers \Altamira\Chart::createManySeries
  * @covers \Altamira\Chart::createSeries
  * @covers \Altamira\Chart::getDiv
  */
 public function testChart()
 {
     $exception = false;
     try {
         $chart = new \Altamira\Chart('');
     } catch (Exception $exception) {
     }
     $this->assertInstanceOf('Exception', $exception, '\\Altamira\\Chart should throw an exception if it passed an empty name');
     $jqplotChart = new \Altamira\Chart('chart 1');
     $flotChart = new \Altamira\Chart('chart2', \Altamira\JsWriter\Flot::LIBRARY);
     $libraryException = false;
     try {
         $crapChart = new \Altamira\Chart('chart3', 'notareallibrary');
     } catch (Exception $libraryException) {
     }
     $this->assertInstanceOf('Exception', $libraryException, 'A chart should throw an exception if we don\'t support the library.');
     $this->assertInstanceOf('\\Altamira\\JsWriter\\JqPlot', $jqplotChart->getJsWriter(), 'Charts should register a JqPlot JsWriter by default');
     $writermethods = array('useHighlighting', 'useZooming', 'useCursor', 'useDates', 'setAxisTicks', 'setAxisOptions', 'setOption', 'getOption', 'setType', 'setTypeOption', 'setLegend', 'setGrid', 'getType', 'getFiles', 'getScript', 'getLibrary');
     $mockJqPlotWriter = $this->getMock('\\Altamira\\JsWriter\\JqPlot', $writermethods, array($jqplotChart));
     $mockFlotWriter = $this->getMock('\\Altamira\\JsWriter\\Flot', $writermethods, array($flotChart));
     $jsWriterReflection = new ReflectionProperty('\\Altamira\\Chart', 'jsWriter');
     $jsWriterReflection->setAccessible(true);
     $jsWriterReflection->setValue($jqplotChart, $mockJqPlotWriter);
     $jsWriterReflection->setValue($flotChart, $mockFlotWriter);
     $this->assertEquals('chart_1', $jqplotChart->getName(), 'Name values should be normalized to turn whitespace into underscores');
     $flotChart->setTitle('This is a flot chart');
     $this->assertEquals('This is a flot chart', $flotChart->getTitle(), '\\Altamira\\Chart::getTitle should return title if set');
     $this->assertEquals('chart_1', $jqplotChart->getTitle(), '\\Altamira\\Chart::getTitle should return name if title not set');
     $mockJqPlotWriter->expects($this->once())->method('useHighlighting')->with(array('size' => 7.5));
     $this->assertEquals($jqplotChart, $jqplotChart->useHighlighting(), '\\Altamira\\Chart::useHighlighting should provide a fluent interface');
     $mockJqPlotWriter->expects($this->once())->method('useZooming');
     $this->assertEquals($jqplotChart, $jqplotChart->useZooming(), '\\Altamira\\Chart::useZooming should provide a fluent interface');
     $mockJqPlotWriter->expects($this->once())->method('useCursor');
     $this->assertEquals($jqplotChart, $jqplotChart->useCursor(), '\\Altamira\\Chart::useCursor should provide a fluent interface');
     $mockJqPlotWriter->expects($this->once())->method('useDates');
     $this->assertEquals($jqplotChart, $jqplotChart->useDates(), '\\Altamira\\Chart::useDates should provide a fluent interface');
     $mockJqPlotWriter->expects($this->once())->method('setAxisTicks')->with('x', array('one', 'two', 'three'));
     $this->assertEquals($jqplotChart, $jqplotChart->setAxisTicks('x', array('one', 'two', 'three')), '\\Altamira\\Chart::setAxisTicks should provide a fluent interface');
     $mockJqPlotWriter->expects($this->once())->method('setAxisOptions')->with('x', 'max', 10);
     $this->assertEquals($jqplotChart, $jqplotChart->setAxisOptions('x', 'max', 10), '\\Altamira\\Chart::setAxisOptions should provide a fluent interface');
     $mockJqPlotWriter->expects($this->at(0))->method('setOption')->with('seriesColors', array('#333333', '#666666'));
     $this->assertEquals($jqplotChart, $jqplotChart->setSeriesColors(array('#333333', '#666666')), '\\Altamira\\Chart::setSeriesColors should provide a fluent interface');
     $mockAxisOptions = array('xaxis' => array('min' => 0, 'max' => 10), 'yaxis' => array('min' => 0, 'max' => 10));
     $mockJqPlotWriter->expects($this->at(0))->method('getOption')->with('axes', array())->will($this->returnValue($mockAxisOptions));
     $mockAxisOptions['xaxis']['label'] = 'x';
     $mockJqPlotWriter->expects($this->at(1))->method('setOption')->with('axes', $mockAxisOptions);
     $this->assertEquals($jqplotChart, $jqplotChart->setAxisLabel('x', 'x'), '\\Altamira\\Chart::setAxisLabel should provide a fluent interface');
     $mockJqPlotWriter->expects($this->once())->method('setType')->with('Donut');
     $this->assertEquals($jqplotChart, $jqplotChart->setType('Donut'), '\\Altamira\\Chart::setType should provide a fluent interface');
     $mockJqPlotWriter->expects($this->once())->method('setTypeOption')->with('hole', '50px', null);
     $this->assertEquals($jqplotChart, $jqplotChart->setTypeOption('hole', '50px'), '\\Altamira\\Chart::setTypeOption should provide a fluent interface');
     $opts = array('on' => 'true', 'location' => 'ne', 'x' => 0, 'y' => 0);
     $mockJqPlotWriter->expects($this->once())->method('setLegend')->with($opts);
     $this->assertEquals($jqplotChart, $jqplotChart->setLegend(), '\\Altamira\\Chart::setLegend should provide a fluent interface');
     $mockJqPlotWriter->expects($this->once())->method('setGrid')->with(array('on' => true));
     $this->assertEquals($jqplotChart, $jqplotChart->setGrid(), '\\Altamira\\Chart::setGrid should provide a fluent interface');
     $mockJqPlotWriter->expects($this->once())->method('getFiles');
     $jqplotChart->getFiles();
     $mockJqPlotWriter->expects($this->once())->method('getScript');
     $jqplotChart->getScript();
     $seriesData = \Altamira\ChartDatum\TwoDimensionalPointFactory::getFromXValues(array(1, 2, 3));
     $series = $jqplotChart->createSeries($seriesData, 'seriesa', 'Donut');
     $this->assertInstanceOf('\\Altamira\\Series', $series, '\\Altamira\\Chart::createSeries should return an instance of \\Altamira\\Series');
     $this->assertEquals('seriesa', $series->getTitle(), '\\Altamira\\Chart::createSeries should set the series title');
     $this->assertEquals($seriesData, $series->getData(), '\\Altamira\\Chart::createSeries should set the series data');
     $jqplotChart->addSeries($series);
     $seriesArray = $jqplotChart->getSeries();
     $this->assertEquals(array($series->getTitle() => $series), $seriesArray);
     $this->assertArrayHasKey($series->getTitle(), $seriesArray);
     $this->assertEquals($jqplotChart->getLibrary(), $mockJqPlotWriter->getLibrary());
     $styleOptions = array('width' => '100px', 'height' => '200px');
     $this->assertEquals(\Altamira\ChartRenderer::render($jqplotChart, $styleOptions), $jqplotChart->getDiv(100, 200));
 }