X Axis text labels are not rotating in d3

I am working with a D3 stack bar chart.

The fiddle is here

When I am clicking on the Month button, the chart appears with a messy x axis label
enter image description here

I want to rotate the x-axis label’s conditionally in case of a good amount of data (In the fiddle, for months data)

My first step is to rotate the label. I am appending the below part.

  svg.append("g")
            .attr("class", "x axis")
            .attr("transform", "translate(0," + height + ")")
            .call(xAxis)
            .selectAll("text")  
            .style("text-anchor", "end")
            .attr("dx", "-.8em")
            .attr("dy", ".15em")
            .attr("transform", "rotate(-65)" );

I am not sure, why it is not working. Whats the problem here?

243 thoughts on “X Axis text labels are not rotating in d3”

  1. Pingback: herbal viagra
  2. Pingback: viagra pills
  3. Pingback: tab cialis 20mg
  4. Pingback: sildenafil coupon
  5. Pingback: cheapest viagra
  6. Pingback: buy viagra on line
  7. Pingback: viagra vs cialis
  8. Pingback: sildenafil 20mg
  9. Pingback: female viagra pill
  10. Pingback: viagra boys
  11. Pingback: levitra vs viagra
  12. Pingback: sildenafil viagra
  13. Pingback: doctor x viagra
  14. Pingback: viagra receptfritt
  15. Pingback: viagra otc
  16. Pingback: buy viagra
  17. Pingback: otc viagra
  18. Pingback: viagra connect
  19. Pingback: buy liquid cialis

Leave a Comment