score:4

Accepted answer

Try ticks(10, "%") instead of tickValues(d3.range(0, 100, 10))

 var margin = {top: 20, right: 20, bottom: 30, left: 50},
    width = 900- margin.left - margin.right,
    height =450- margin.top - margin.bottom;
    
var svg = d3.select("body").append("svg")
    .attr("width", width + margin.left + margin.right)
    .attr("height", height + margin.top + margin.bottom)
    .append("g")
    .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

   var y0 = d3.scale.linear().range([height, 0]);
    var yAxisLeft = d3.svg.axis()
          .scale(y0)
          .orient("left")
          .ticks(10, "%");
          //.tickValues(d3.range(0, 100, 10));
    svg.append("g")
          .attr("class", "y axis")
          .style("fill", "steelblue")
          .call(yAxisLeft)
          .append('text');
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.0/d3.min.js"></script>
<body></body>


Related Query

More Query from same tag