<script> var testdata1 = [ { "key" : "Rating" , "color" : "#333", "values" : [ <?php printChartData(1, $movieInfoRow['imdbID']); ?> ] }, { "key" : "Votes" , "bar": true, "color": "#ccf", "values" : [ <?php printChartData(0, $movieInfoRow['imdbID']); ?> ] } ].map(function(series) { series.values = series.values.map(function(d) { return {x: d[0], y: d[1] } }); return series; }); //console.log(testdata1); var chart; nv.addGraph(function() { chart = nv.models.linePlusBarChart() .margin({top: 50, right: 80, bottom: 30, left: 80}) .legendRightAxisHint(' [Line]') .forceY([0,10]) .color(d3.scale.category10().range());
public function testRatingString() { $this->assertEquals("[1451692800000,1841],[1451692800000,1841],[1451692800000,1841]", printChartData(0, "test")); $this->assertEquals("[1451692800000,7.8],[1451692800000,7.8],[1451692800000,7.8]", printChartData(1, "test")); }