Nivo: ResponsiveBar: large space between axis y and the first bar

Created on 20 Apr 2020  路  12Comments  路  Source: plouc/nivo

Describe/explain the bug
In case of using large datasets with ResponsiveBar the distance between axis y and the first bar is too large for some widths.

To Reproduce
I created a demo on Code Sandbox. As you resize the display area the distance between axis y and the first bar changes and it becomes too large for some sizes.
https://codesandbox.io/s/nivo-bar-tick-formatting-demo-j1zf9?file=/index.js

Expected behavior
The distance between axis y and the first bar doesn't become unproportionally large when resizing.

Screenshots
K茅perny艖k茅p err艖l: 2020-04-20 11-45-08

bar

Most helpful comment

Same problem here, the bigger the data, the proportionally bigger the distance

All 12 comments

Same problem here, the bigger the data, the proportionally bigger the distance

I also observed that all of the bars will compress into one single spot right in the middle of the graph at around 406 bar elements
screen_shot_2020-05-19_at_2 49 31_pm

Anyone find a solution?

I ran through the related code a few weeks ago when I created this issue. I think it is caused by the calculations made by the d3 library but I'm not 100% sure.

Same issue here, it doesn't look good, and I couldn't find any solution apart from making excuses to complaining customers that it needs a fix from Nivo 馃槥

Question for people affected by this: have you considered using a Line graph?

From The example you provided:

line_

source (forked codesandbox code from your example): https://codesandbox.io/s/nivo-bar-tick-formatting-demo-jso1b?file=/index.js:0-35617

I mention this because I remembered having had exactly the same issue in a couple of other libraries until it hit me: once you have a lot of data points, it makes more sense to just use a line graph to display your values. I think that's how I solved some graph issues here

@barnapisti1994 add the label:":bar_chart: bar" so appear as an open issue for that and let's hope it gets fixed soon

@drodmun I think only contributors can add labels to issues.

Any news for this issue ?

No progress here 馃槩

I think this is related to #840. If so there is a PR in the works to get this solved.

Looks to be fixed by #1282 and will be available in the next version. See here: https://codesandbox.io/s/nivo-forked-y50jx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luisrudge picture luisrudge  路  3Comments

danpettay picture danpettay  路  3Comments

KENNYSOFT picture KENNYSOFT  路  3Comments

serendipity1004 picture serendipity1004  路  3Comments

pratikguru picture pratikguru  路  3Comments