ResponsiveBar overlap on the X axis
See original GitHub issueHello @nivo users, I have a very curious issue on the responsive bar that I want to show you. Everything is working as expected locally as you can see below:
But when deploying on Netlify the bars are overlapping on the X axis:
Is there something I’m missing ? Does anyone of you have an idea of where it might come from ? Desktop (please complete the following information):
- OS: Windows 10
- Browser Chrome
- Version 87.0.4280.141
Additional context Here are my npm version of the tools I’m using:
"webpack": "^5.4.0",
"@nivo/bar": "^0.66.0",
"@nivo/core": "^0.66.0",
"react": "^17.0.1",
"typescript": "^4.1.3",
Here the component I’m using :
export const BarChart = (props: Props) => {
const { data, keys, indexBy, legendLeft, colors, labels, markers } = props;
return (
<ResponsiveBar
data={data}
keys={keys}
margin={{ top: 50, right: 0, bottom: 50, left: 60 }}
padding={0.3}
indexBy={indexBy}
valueScale={{ type: 'linear' }}
indexScale={{ type: 'band', round: true }}
colors={colors}
label={labels}
animate={false}
axisBottom={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legendPosition: 'middle',
legendOffset: 32
}}
axisLeft={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: legendLeft,
legendPosition: 'middle',
legendOffset: -40
}}
labelSkipWidth={12}
labelSkipHeight={12}
markers={markers}
/>
);
};
export default BarChart;
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
X-axis labels on bar chart overlapping - The Dundas Community
HI, Had a question bout X-axis labels on bar chart overlapping (see attached screenshots) - when I initially add more than 5 selections...
Read more >Nivo Responsive Horizontal Bar - Numeric values are not ...
I'm creating a Horizontal Bar chart using @Nivo Responsive bar, ... data and have noticed that this value is showing always on x-axis...
Read more >Bar chart | nivo
Bar chart which can display multiple data series, stacked or side by side. Also supports both vertical and horizontal layout, with negative values ......
Read more >Nivo Bar Chart Axis Labels Overlapping - ADocLib
Hello @nivo users, I have a very curious issue on the responsive bar that I But when deploying on Netlify the bars are...
Read more >d3.js axis labels not displaying in responsive bar chart-d3.js
SVG height and x axis starting from the same position. So the visibility of the axis will hidden because axis tick and text...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same problem here! It happened with ResponsiveBar and ResponsiveLine.
When we put margin on bottom to show the tickValues and minValue is set, the bar just overflow.
With ResponsiveLine, we can see same effect if enableArea is True, and yScale.min is Set
Info
Example Here
I was able to “somehow” fix the issue using the
ResponsiveBarCanvas
component instead of theResponsiveBar
… You lose the label on column but at least it looks like something… In another part of my app I used the Nivo API and it works perfectly so I strongly advise anyone encountering this kind of issue to give it a try !