Bar chart X axis autorange not working as expected ?
See original GitHub issueI 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:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top 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 >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
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.Closed by @LoganWlv in #5211