C3: Ensure sufficient space between x axis tick values and x axis label

Created on 20 Aug 2015  路  5Comments  路  Source: c3js/c3

The data values which I am using for generating charts are large sometimes.After the chart is rendered the tick labels are overlapping the x axis label(placed in outer -middle position).Because of the height sometimes part of labels are missing.Can we ensure the labels are displayed correctly(full) even if it is multi-line and ensure there is sufficient space between tick values and x axis label,so that they do not overlap with each other.

Most helpful comment

Hi,
as you can see at the page Rotate X Axis Tick Text, you should set height parameter.

...
    axis: {
        x: {
            type: 'category',
            tick: {
                rotate: 75,
                multiline: false
            },
            height: 130
        }
    }
...

All 5 comments

image

Any news on this? I am having the same issue and want to avoid writing a workaround.

The screenshot shows what happens: the x-axis label "Opening medium" overlaps the tick labels, in this case "Anonymous text 1". A static fix won't help, because tick label lengths vary depending on the chart and filter selections.

Hi,
as you can see at the page Rotate X Axis Tick Text, you should set height parameter.

...
    axis: {
        x: {
            type: 'category',
            tick: {
                rotate: 75,
                multiline: false
            },
            height: 130
        }
    }
...

Thanks Felipe - sorted the issue out. Will set the height dynamically depending on the longest tick label text.

@aendrew this question seems answered, can be closed ?

yes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Shugardude picture Shugardude  路  4Comments

mwho picture mwho  路  3Comments

udhaya2kmrv picture udhaya2kmrv  路  3Comments

jstone-ponderosa picture jstone-ponderosa  路  3Comments

aishwaryak picture aishwaryak  路  4Comments