Hello,
With scattergl, I cannot display the text that is stored in the traces data structure.
In scatter, I use the type:markers+text, but it seems not working the same way with scattergl.
Thanks for your help!
var trace = {
x: [1, 2, 3, 4, 5],
y: [1, 6, 3, 6, 1],
mode: ‘markers+text’,
type: ‘scattergl’,
name: ‘Team A’,
text: [‘A-1’, ‘A-2’, ‘A-3’, ‘A-4’, ‘A-5’],
textposition: ‘top center’,
textfont: {
family: ‘Raleway, sans-serif’
},
marker: { size: 12 }
};
var layout = {
xaxis: {title: ‘PC’ + dim1, type:‘linear’},
yaxis: {title: ‘PC’ + dim2, type:‘linear’},
hovermode: ‘closest’,
dragmode:‘pan’,
showlegend:false,
margin: { t: 0 },
legend: {
yref: ‘paper’,
font: {
family: ‘Arial, sans-serif’,
size: 20,
color: ‘grey’,
}
},
title:‘test plot’
};
Plotly.plot(‘myDiv’, [trace] , layout);