public function test() { $options = new HighchartOptions(); $options->title = new Title(['text' => 'Monthly Average Temperature', 'x' => -20]); $options->subtitle = ['text' => 'Source: WorldClimate.com', 'x' => -20]; $this->assertEquals('{"title":{"text":"Monthly Average Temperature","x":-20},"subtitle":{"text":"Source: WorldClimate.com","x":-20}}', $options->toJson()); }
public function registerScript() { $id = $this->getId(); $this->options->setRenderTo($id); $js = "new Highcharts.Chart({$this->options});"; $this->getView()->registerJs($js, View::POS_READY, __CLASS__ . '#' . $id); }
public function testHighchartOptionsGetter() { $this->assertEquals([], $this->model->getColors()); $this->assertInstanceOf(Chart::class, $this->model->getChart()); $this->assertInstanceOf(Credits::class, $this->model->getCredits()); $this->assertInstanceOf(Data::class, $this->model->getData()); $this->assertInstanceOf(DrillDown::class, $this->model->getDrillDown()); $this->assertInstanceOf(Exporting::class, $this->model->getExporting()); $this->assertInstanceOf(Labels::class, $this->model->getLabels()); $this->assertInstanceOf(Legend::class, $this->model->getLegend()); $this->assertInstanceOf(Loading::class, $this->model->getLoading()); $this->assertInstanceOf(Navigation::class, $this->model->getNavigation()); $this->assertInstanceOf(NoData::class, $this->model->getNoData()); $this->assertInstanceOf(Pane::class, $this->model->getPane()); $this->assertInstanceOf(PlotOptions::class, $this->model->getPlotOptions()); //$this->assertInstanceOf(Series::class, $this->model->getSeries()); $this->assertInstanceOf(SubTitle::class, $this->model->getSubTitle()); $this->assertInstanceOf(Title::class, $this->model->getTitle()); $this->assertInstanceOf(Tooltip::class, $this->model->getTooltip()); //$this->assertInstanceOf(xAxis::class, $this->model->getXAxis()); //$this->assertInstanceOf(yAxis::class, $this->model->getYAxis()); }