When I update data in an existing NVD3 chart, ticks along the x axis do not appear at fixed intervals.
I am creating a multiBarChart with data retrieved from d3.json() . The data are hits in a date range. I have a separate date range selection that updates the chart data.
I have the following to create a graph (simplified):
initGraph = function(url) { d3.json(url, function(data) { nv.addGraph(function() { chart = nv.models.multiBarChart(); d3.select('#chart svg').datum(data).transition().duration(500).call(chart); nv.utils.windowResize(chart.update); return chart; }); }); };
And the following function to update it, which is called in the date picker:
redrawGraph = function(url) { d3.json(url, function(data) { d3.select('#chart svg').datum(data).transition().duration(500).call(chart); nv.utils.windowResize(chart.update); }); };
Everything seems fine, but sometimes the tick interval ends in inconsistent:

This only happens when updating an existing chart.
I spent quite a bit of time validating the data - that the x values ββincrease by fixed values ββ- so I can only think that I am missing something when redrawing the chart.
nullPainter
source share