Hi, I am new to Plotly. I have tried to plot data in the form of bar charts with the data coming from a Pandas Dataframe. The X-axis represents a datetime column and the Y-axis represents a numeric column. When there is data for a lot of dates, the plot is as expected, but if there is data for just a single day, then the width of the bar becomes really thin such that it is not visible in the plot and is only visible when zoomed in to that particular day(and hour). I have attached images for reference of the whole plot and zoomed in plot. The code I am using for plotting is given below:
Hi there!
Did you find a solution to this problem?
Coincidentally, I am facing the EXACT SAME issue!
Why isnโt anyone paying attention to this?
Can anyone help??!?!??!!
NOTE For the plot with 2 data points, the dates are 17th May and 26th May, but the width is so large that it covers 3-4 days. Is there some resolution for that??!
In regard to the second figure with two bar plots being plotted, one way to show them thinner, so they are above their respective days, is to increase the bargap from 0.3 to 0.9
All of these issues come down to cases where itโs tough for us to automatically decide on a bar width, or we donโt pick the one you wanted. We have an issue open to improve the width we choose when thereโs only one bar but if you know the bar width you want you can provide it yourself, as a number of milliseconds. width = 1000 * 3600 * 24 โ one day exactly width = 1000 * 3600 * 24 * 0.8 โ 80% of a day, same as bargap=0.2 if we were to detect a one-day spacing.