Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Boxplot hoverinfo text not display

var trace1 = { x: [ '2016-08-23','2016-08-23','2016-08-23','2016-08-23','2016-08-23','2016-08-23', '2016-08-24','2016-08-24','2016-08-24','2016-08-24','2016-08-24','2016-08-24' ], y: [ 100,120,125,125,125,128, 115,123,121,121,121,125 ], boxpoints: false, fillcolor: "#96c8fa", line: {color: "#96c8fa"}, showlegend: false, type: "box", whiskerwidth: 0, hoverinfo: 'text', text:[ "D:2016-08-23<br>O:120<br>h:128<br>l:100<br>c:125", "D:2016-08-24<br>O:123<br>h:125<br>l:115<br>c:121" ] }; var data = [trace1]; var layout = { title: "Box TEST", xaxis: {title: "date"}, yaxis: {title: "price"} }; Plotly.plot('plotDiv', data, layout);

How do you let the display the hover text to the plot ?

That’s correct. box traces don’t support the text attribute at the moment.

You can verify this using Plotly.validate

Plotly.validate([{ type: 'box', x: [1,1,2,2,2,3,3,3], text: ['a', 'b', 'c'] }]);

// => In data trace 0, key text is not part of the schema

Adding support for it isn’t obvious because x / y data in box traces don’t match 1-to-1 with the display graphical items.

OK, thanks a lot. I 'll try to implement in different ways.

I’d recommend using data-referenced layout.annotations for this tasks.

I ran into this thread while trying to figure out why the text would not display on the boxplot. I noticed that when exported to the text is displayed on the points, however, it does not display on the chart on my page. I used “Plotly.validate” and it shows that “text is not part of the schema”. Searching around, it looks like hover text is also supported in the python plotly…

Is there a plan to implement this in plotly.js, or is the ‘layout.annotations’ still the only way to accomplish this?