I am currently using ZoomData for my vizualisation needs. I also use NVD3 library to add a LineChart to Zoomdata, since there is not a template for what i need. With absolutely no documentation whatsoever, i am in deep trouble. :)
I watched the ZoomData videos on Youtube. Therefore i understood the controller thing for rendering custom charts. I have a data file that i read, with dates (X Axis) and values for these dates (Y Axis).
My problem is i can't seem to get the dates to be rendered properly. My line chart does not show in some cases. However, it works fine with simple data set (like an array of numbers). Here is my code so far :
var svg = d3.select(controller.element).append("svg")
.attr("width", "100%")
.attr("height", "100%");
var format = d3.time.format("%Y-%m-%d");
var chart;
nv.addGraph(function() {
CreateLabels();
chart = nv.models.lineChart()
.options({
margin: {left: 100, bottom: 100},
// x: function(d,i) { return i},
showXAxis: true,
showYAxis: true,
transitionDuration: 250
})
;
chart.x(function(d){return d.group});
chart.y(function(d,i){return d.current.count});
Now i need help on data format for the axis. I have dates going from 2014 to 2015, and what i see on the X axis is : 2014.2 2014.4 2014.6 .... 2015. I don't understand what is going on here, and my NVD3 line chart is not showing properly. Thanks for the read, hope this is clear enough.
Finally, my ZoomData Update function, where i get my data.
controller.update = function(data)
{
var newData = [{key:"Test Line", values: data }];
d3.select(controller.element).select("svg")
.datum(newData)
.call(chart)
;
}