The main question of D3.js is to handle the syntax!
I am using D3 and I want to create an axis if it does not exist, or update using a transition if it already exists.
My current code is below, but this code re-creates the axis every time - it does not go over. How can I change it to transition?
var xAxis = d3.svg.axis().scale(x).orient("bottom").ticks(4).tickSize(6, 3, 0); updateGraphAndAxes(initialdata); $('#button').click(function() { updateGraphAndAxes(newdata); }); function updateGraphAndAxes(newdata) {
source share