コード例 #1
0
ファイル: RawTest.php プロジェクト: catchamonkey/phighcharts
 /**
  * Raw encode/decode when the subject is json encoded for render
  */
 public function testRawRender()
 {
     $testData = array('foo' => Raw::encode('bar'));
     //expect the property 'bar' to be rendered as raw string and not wrapped
     //in the JSON standard quotes after being JSON encoded
     $expected = '{"foo":bar}';
     $this->assertEquals($expected, Raw::decode(json_encode($testData)));
 }
コード例 #2
0
ファイル: Datetime.php プロジェクト: catchamonkey/phighcharts
 /**
  * Returns the plottable chart data formatter as js Date
  * @param  Array $seriesData Series data as supplied by the user
  * @return Array
  */
 public function getFormattedChartData(array $seriesData)
 {
     $ret = array();
     foreach ($seriesData as $date => $value) {
         //render the js Date obect as raw
         $ret[] = Raw::encode('[' . $this->_convertStringToJsDate($date) . ',' . $value . ']');
     }
     return $ret;
 }