public function testSentimentString() { $this->assertEquals("[1449304204000,3],[1449520204000,4]", printSentiment(0, "test")); $this->assertEquals("[1449304204000,1],[1449520204000,1]", printSentiment(1, "test")); $this->assertEquals("[1449304204000,17],[1449520204000,12]", printSentiment(2, "test")); $this->assertEquals("[1449304204000,21],[1449520204000,17]", printSentiment(3, "test")); }
] }, { "key" : "Negative" , "bar": true, "color" : "red", "values" : [ <?php printSentiment(1, normalizeCaseSen($movieInfoRow['name'])); ?> ] },{ "key" : "Neutral" , "bar": true, "color": "#ccf", "values" : [ <?php printSentiment(2, normalizeCaseSen($movieInfoRow['name'])); ?> ] } ].map(function(series) { series.values = series.values.map(function(d) { return {x: d[0], y: d[1] } }); return series; }); console.log(testdata); var chart; nv.addGraph(function() { var chart = nv.models.multiBarChart(); chart.xAxis .tickFormat(function(d) { return d3.time.format('%x')(new Date(d))