Perfect, it’s what I wanted, thank you. Other question, this logic use for your code is usable with d3.js?
Yes, but this code only change the dimension of the rectangle after the click, what I want is that after the click on one rectangle changes the position with the rectangle above it, in you example the rectangle red change the position with the rectangle blu Thank you for the answer.
The stacked bar are the 100% stacked bar chart and each bar is composed by 5 rectangle and I have to change the position of the rectangle in the bar, I’m not sure that mousemove can help me.