From 6eb2cf82769d9b8320c2970c3027d0beb9cb322f Mon Sep 17 00:00:00 2001 From: Rajiv Seelam Date: Sun, 28 Dec 2014 00:42:08 +0530 Subject: [PATCH] Make Changes for adding and firing events --- src/Khill/Lavacharts/Charts/Chart.php | 2 +- src/Khill/Lavacharts/JavascriptFactory.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Khill/Lavacharts/Charts/Chart.php b/src/Khill/Lavacharts/Charts/Chart.php index 0c1c0557..1ea94da8 100755 --- a/src/Khill/Lavacharts/Charts/Chart.php +++ b/src/Khill/Lavacharts/Charts/Chart.php @@ -296,7 +296,7 @@ public function events($e) if (is_array($e)) { foreach ($e as $event) { - if (is_subclass_of($event, 'Lavacharts\Events\Event')) { + if (is_subclass_of($event, 'Khill\Lavacharts\Events\Event')) { $this->events[] = $event; } else { throw $this->invalidConfigValue( diff --git a/src/Khill/Lavacharts/JavascriptFactory.php b/src/Khill/Lavacharts/JavascriptFactory.php index 49852520..ea032416 100755 --- a/src/Khill/Lavacharts/JavascriptFactory.php +++ b/src/Khill/Lavacharts/JavascriptFactory.php @@ -181,12 +181,13 @@ private function buildChartJs() $out .= $this->buildFormatters(); } - $out .= '$this.chart.draw($this.data, $this.options);'.PHP_EOL; - if ($this->chart->hasEvents()) { $out .= $this->buildEventCallbacks(); } + $out .= '$this.chart.draw($this.data, $this.options);'.PHP_EOL; + + $out .= "};".PHP_EOL.PHP_EOL; switch ($this->chart->type) {