Exemple #1
0
 /**
  * Get main functionalities for this plot
  * @return string
  */
 private function getMainJS()
 {
     return 'RunalyzePlot.addPlot("' . $this->cssID . '", ' . json_encode($this->Data) . ', ' . Ajax::json_encode_jsfunc($this->Options) . ', ' . json_encode($this->PlotOptions) . ', ' . json_encode($this->Annotations) . ');';
 }
Exemple #2
0
 public function testJSONencode()
 {
     $this->assertEquals('{' . '"int":1,' . '"float":3.14,' . '"bool":true,' . '"null":null,' . '"string":"foo",' . '"func1":function test1() { return 1; },' . '"func2":function test2() { return 2; },' . '"func3":function test3() { return 3; }' . '}', Ajax::json_encode_jsfunc(array('int' => 1, 'float' => 3.14, 'bool' => true, 'null' => null, 'string' => 'foo', 'func1' => 'function test1() { return 1; }', 'func2' => 'function test2() { return 2; }', 'func3' => 'function test3() { return 3; }')));
 }