plotly.js
plotly.js copied to clipboard
bar width doesn't works when x axis is a date
Hi,
Here is an example : https://codepen.io/anon/pen/LzVyOB
I took an example found here : https://community.plot.ly/t/how-do-i-change-the-width-of-each-the-bar/2409/2 But couldn't understand why it wouldn't works on my data, until I found that when using date axis it doesn't works (but it works when using numerical or string X axis !)
Regards.
Hi @Kurairaito - try this:
width: fill(10, () => Math.random()*1000*3600*24)
Date axes are internally converted to milliseconds, so differences on a date axis need to be represented as milliseconds as well - of which there are 1000*3600*24 in a day.
Thanks that works fine !