C3: Add ability to hide X-Axis

Created on 8 Apr 2014  路  9Comments  路  Source: c3js/c3

We currently have the ability to hide Y-Axis but we need to hide X-Axis too.

(case-in-point: sparkline charts).

C-feature-request resolved maybe

Most helpful comment

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 30, 200, 100, 400, 150, 250],
            ['data2', 50, 20, 10, 40, 15, 25]
        ]
    },
        axis: {
            x: {show:false},
            y: {show:false}
        }
});

All 9 comments

I agree. I'll add this feature. Please give me some time.

Thanks. We have a workaround to hide it via css.

@KetanJavia I added axis.x.show option for hiding x axis by the commit above. Could you try this on the latest code? I'll update the version later.

Thanks. That worked!

@kjavia can you share your sparkline code? :)

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 30, 200, 100, 400, 150, 250],
            ['data2', 50, 20, 10, 40, 15, 25]
        ]
    },
        axis: {
            x: {show:false},
            y: {show:false}
        }
});

Duh. Sorry! I thought it was something more specific. But I guess it's just a matter of making it really small. Thanks!

axis: {show:false} works too

@masayuki0812: Is there any way to keep the labels when removing the axis? Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wojciechowskid picture wojciechowskid  路  3Comments

MarcusJT picture MarcusJT  路  4Comments

Saikat-Sinha picture Saikat-Sinha  路  3Comments

unlight picture unlight  路  3Comments

Shugardude picture Shugardude  路  4Comments