Refactoring yScale
Refactored d3 transition
Refactoring xScale