Black Lives Matter. Please consider donating to Black Girls Code today.

Difference between 2 bars by drawing a line on any two individual bars in plotly bar

We have a requirement, to draw a line on plotly bar graph by connecting two individual bars, after drawing, the line should display the difference value between the two individual bars.

Also an individual bar allows to add any text manually instead of tooltip text?

If these are available in any paid version of plotly, we are ready to purcharse. So please check and get back to us ASAP.

Hi @padigelasw, you can display any array of text entries with the text attribute of go.Bar, as in https://plot.ly/python/bar-charts/#bar-chart-with-direct-labels (in Python, or https://plot.ly/javascript/bar-charts/#bar-chart-with-direct-labels for Javascript). For the line drawing, could you please attach a schematic drawing so that we can see exactly what you are looking for?

We want connectors for showing difference on top of bars. Attached screen shot for reference

You can use line shapes for the lines and annotations for the text labels. The documentation is

Thanks Emmanuelle, but my requirement is to draw a line by connecting individual bars using mouse, and after connecting bars we have to show the difference on to of the line. these lines can be multiple user can draw n number combinations on top of bars.