1

I'm trying this code in JS to rotate cols labels:

heatMap.renderlet(function (chart) {
chart.selectAll("g.cols text")
    .attr("transform", "translate(-10,10)")
    .attr("transform", "rotate(315)")
    .style("text-anchor", "end");});

But the only result is that all labels translate and rotate together: Heatmap image

What am I doing wrong?

Thank's in advance

Marvin 2
  • 41
  • 4
  • From the answer I linked, do: `chart.selectAll("g.cols text").attr("transform", function(d){ var t = d3.select(this); return "rotate(315," + t.attr('x') + "," + t.attr('y') + ")"}).style("text-anchor", "end");` – Mark Oct 07 '18 at 13:19
  • It works! Thanks! – Marvin 2 Oct 07 '18 at 13:25

0 Answers0