C3: C3 rotate y-axis label

Created on 2 Sep 2016  ·  4Comments  ·  Source: c3js/c3

Currently the y-axis label is oriented like this: http://imgur.com/a/fbJQb

Either the functionality doesn't exist out of the box or my Google Foo is failing (this is probably the case), but is it possible to make "Friend" the same orientation as the 400? As in, I want the y-axis label to read left-to-right instead of bottom-to-top.

Most helpful comment

Having a axis.y.label.rotate (and axis.y2.label.rotate) option like for axis.y.ticks.rotate would be awesome!

All 4 comments

@alexanderbanks, you can do removing transform attribute of y axis label element as below.
To control the label element position, you need set proper attributes(x, y, dy, dx) values on your necessities.

c3.generate({
    data: { ... },
    onrendered: function() {
       // remove transform attribute
        d3.select("."+ c3.chart.internal.fn.CLASS.axisYLabel)
            .attr("transform",null);
    }
});

Fixed. I should've taken a closer look at your second sentence. Thanks.

Having a axis.y.label.rotate (and axis.y2.label.rotate) option like for axis.y.ticks.rotate would be awesome!

Hey can we rotate a donut chart by 180 deg along the y-axis?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

udhaya2kmrv picture udhaya2kmrv  ·  3Comments

Zerim picture Zerim  ·  3Comments

MarcusJT picture MarcusJT  ·  4Comments

aishwaryak picture aishwaryak  ·  4Comments

kethomassen picture kethomassen  ·  3Comments