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.

Bar chart X axis autorange not working as expected ?

See original GitHub issue

I have a bart chart with X axis autorange enabled. X is of type “category” with numbers and a single string to represent not known values. Somehow the chart is not fully displayed.

Here a minimal example with the issue :

https://codepen.io/loganwlv/pen/mdEdYLW

EDIT: Some extra information can be found there -> stack_overflow It seems with 7.5  instead of 7.5 on X the graph is displayed as expected

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
alexcjohnsoncommented, Oct 11, 2020

Thanks for the report @LoganWlv - this is indeed a bug, the problem is that the range of a category axis is normally expressed in units of the category serial numbers, and as you have 8 categories (0 to 7) and you want to see the whole of each bar (±0.5) the autorange value is [-0.5, 7.5].

The bug is that apparently when we then re-interpret that range to draw the graph, because you have a category of the same name we take 7.5 to mean “the serial number of category 7.5.” I imagine we’re trying to be flexible and allow you to specify like range: ['apples', 'oranges'] but honestly that’s rarely useful because of the ±0.5, or related padding on scatter and other trace types.

0reactions
alexcjohnsoncommented, Oct 13, 2020

Closed by @LoganWlv in #5211

Read more comments on GitHub >

github_iconTop Results From Across the Web

PlotlyJS bar chart X axis autorange not working as expected?
This sure is weird. It seem to me that although you set type: "category" for the x axis, plotly attempts to determine the...
Read more >
Bug in Auto Range of Bar Chart - Microsoft Power BI Community
When entering a constant line in "Analytics" of a bar chart, I expect the line to be displayed. The default settings of automatically....
Read more >
Python Figure Reference: layout.xaxis - Plotly
Determines whether or not the range of this axis in the rangeslider use the same value than in the main plot when zooming...
Read more >
Automatic expression axis ranges are too high - Qlik Community
Problem : I've built a combo chart that has unexpectedly large values ... axis to change to a value that was expected, and...
Read more >
XY Chart - bar category fixed axis range - Ignition
The first issue seems to be that the X axis isn't really a numeric scale like i would want. Ideally this would be...
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