Sat*_*shV 5 javascript css plotly.js
如下面的代码笔所示,轨迹 1 的文本值正在被修剪,因为它靠近图表边框。需要显示这些数字高于一切。已尝试设置 z-index。没用。
https://codepen.io/satishvarada/pen/yLVoqqo
var trace1 = {
x: [1, 2, 3, 4],
y: [16, 16, 16, 16],
type: 'scatter',
text:[16, 16, 16, 16],
textposition:'top',
mode:'lines+markers+text'
};
var trace2 = {
x: [1, 2, 3, 4],
y: [16, 5, 11, 9],
type: 'scatter',
mode:'lines+markers+text'
};
var data = [trace1, trace2];
Plotly.newPlot('myDiv', data);
Run Code Online (Sandbox Code Playgroud)