How to build a floating bar chart
Last updated
Last updated
First, make sure to include the Plotly.js library in your HTML file. You can either download it and host it locally, or include it via a CDN.
Organize your data for the floating bars. You need two points of data for each bar: the start point and the end point.
Use the base
attribute to specify the starting point of each bar, and the x
or y
attribute (depending on orientation) to specify the length of each bar.
Horizontal
If
Vertical