//dashboard data-chart-line added

This commit is contained in:
Vincent Augagneur
2013-09-05 19:07:49 +02:00
parent e7495f3fe4
commit 4b2ef10dd6
5 changed files with 73 additions and 68 deletions
+28
View File
@@ -0,0 +1,28 @@
function line_chart_trends(widget_name, chart_details)
{
console.log(chart_details.data);
nv.addGraph(function() {
var chart = nv.models.lineChart()
.useInteractiveGuideline(true)
.x(function(d) { return d[0] })
.y(function(d) { return d[1]/100 })
.color(d3.scale.category10().range());
chart.xAxis
.tickFormat(function(d) {
return d3.time.format('%m/%d/%y')(new Date(d))
});
chart.yAxis
.tickFormat(d3.format(',.1%'));
d3.select('#dash_trends_chart1 svg')
.datum(chart_details.data)
.call(chart);
//TODO: Figure out a good way to do this automatically
nv.utils.windowResize(chart.update);
return chart;
});
}