question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ResponsiveBar overlap on the X axis

See original GitHub issue

Hello @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:

image

But when deploying on Netlify the bars are overlapping on the X axis:

image

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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

2reactions
LucasEduardoRomerocommented, Jan 27, 2021

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

  • @nivo/bar”: “^0.67.0”,
  • @nivo/core”: “^0.67.0”,
  • @nivo/line”: “^0.67.0”,
  • @nivo/pie”: “^0.67.0”,
  • “react”: “^16.13.1”,
  • “typescript”: “^3.8.3”

Example Here

0reactions
GregdTdcommented, May 13, 2021

I was able to “somehow” fix the issue using the ResponsiveBarCanvas component instead of the ResponsiveBar… 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 !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found