Recharts: XAxis don't show first item dataKey value as label

Created on 13 Aug 2017  路  3Comments  路  Source: recharts/recharts

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

XAxis don't show first item as label

Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?

1.0.0-alpha.3

Code here:

const data = [
            {name: 'V膷era', value: 2200},
            {name: 'Dnes', value: 2600},
            {name: 'Z铆tra', value: 2300}
        ]

<LineChart width={200} height={100} data={data}>
   <Line type="monotone" dataKey="value" stroke="#8884d8" />
   <XAxis dataKey="name"  />
</LineChart>

Image of rendered code

screen_recharts

Most helpful comment

figure it out. Passing the prop interval="preserveStartEnd" to XAxis resolves it

All 3 comments

Did you figure this out?

figure it out. Passing the prop interval="preserveStartEnd" to XAxis resolves it

Thx @nathmack

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexandersoto picture alexandersoto  路  3Comments

Eric24 picture Eric24  路  3Comments

scottdickerson picture scottdickerson  路  3Comments

FabioFleitas picture FabioFleitas  路  3Comments

velociwabbit picture velociwabbit  路  3Comments