Skip to content

Instantly share code, notes, and snippets.

@codetricity
Last active September 4, 2018 12:37
Show Gist options
  • Select an option

  • Save codetricity/b1230a404086704549bdd51b09881412 to your computer and use it in GitHub Desktop.

Select an option

Save codetricity/b1230a404086704549bdd51b09881412 to your computer and use it in GitHub Desktop.
continuation of text rotation

alter x axis

Imgur

 .attr("x", function(d, i){
        return i * 40 + margin;
        
        
.attr("transform", function(d, i){
        var angle = i * 30;
        var x = i * 40 + margin;
        return   "rotate(" + angle + "," +
            x + ", 200)";
    })

adjust y axis

Imgur

    .attr("y", function(d, i){
        return i * 30 + margin;
    })

adjust scale

Imgur

        return   "rotate(" + angle + "," +
            x + "," + y + ")" +
            "scale(0.5, 0.5) ";

Adjust color

    .style('fill', function(d, i){

        var b = i * 13;
        return 'rgb(211,' + b + ' ,255)';
    })

color

In the example above, I also adjusted the x spacing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment