I am using cubism to display some data. Is it possible to animate the rule which appears when we hover the mouse over the graph.
I want to animate it in such a way so that it automatically displays data on each step from left to right then right to left.
i tried using the d3.timer but it doesn't solve the problem. Here is my code -
var x=30;
var ruler = d3.select("#viz").append("div")
.attr("class", "rule")
.attr("x", x)
.call(context.rule());
var interval = 1000;
var makeCallback = function() {
return function() {
if(x<1116){
x = x+1;
}
else{x=30;}
ruler.transition().attr("x", x);
d3.timer(makeCallback(),interval);
return true;
}
};
d3.timer(makeCallback(), interval);
It works if i use a normal svg but not in this case. Any ideas?