Ejemplo n.º 1
0
 /**
  * Builds the javascript object of event callbacks.
  *
  * @access private
  * @return string Javascript code block.
  */
 private function buildEventCallbacks()
 {
     $output = '';
     $events = $this->chart->getEvents();
     foreach ($events as $event => $callback) {
         $output .= sprintf('google.visualization.events.addListener($this.chart, "%1$s", function (event) {' . '    return lava.event(event, $this.chart, %2$s);' . '});', $event, $callback) . PHP_EOL . PHP_EOL;
     }
     return $output;
 }
 /**
  * Builds the javascript object of event callbacks.
  *
  * @access private
  *
  * @return string Javascript code block.
  */
 private function buildEventCallbacks()
 {
     $out = '';
     foreach ($this->chart->getEvents() as $event) {
         $callback = sprintf('function (event) {return lava.event(event, $this.chart, %s);}', $event->callback);
         $out .= sprintf('google.visualization.events.addListener($this.chart, "%s", %s);', $event::TYPE, $callback) . PHP_EOL . PHP_EOL;
     }
     return $out;
 }