首页 > 解决方案 > Plotly 模式栏运行在两行而不是一行

问题描述

创建绘图时,我的 Plotly 模式栏运行在两行而不是一行。有什么想法吗?

情节图片

exports.createPlot = function(){

  var trace1 = {
    x: [1, 2, 3, 4],
    y: [10, 15, 13, 17],
    type: 'scatter'
  };

  var trace2 = {
    x: [1, 2, 3, 4],
    y: [16, 5, 11, 9],
    type: 'scatter'
  };

  var data = [trace1, trace2];
  var layout = {
    showlegend: false,
    updatemenus: updatemenus,
  };

  Plotly.newPlot('plot', data, layout, {displayModeBar: true});

  //display mode set to true for the purpose of taking the screenshot
}

通常模式栏像我见过的所有示例一样运行在一行上。

更新:

这是父 div.main 和 plot div.plot-panel 的 CSS:

div.main-content
{
  border: 1px solid white;
  background-color: #EBEDEB;
  display: inline-block;
  float: none;
  left: 162px;
  height: 86.6%;
  margin: 0px;
  top: 114px;
  position: absolute;
  width: 90%;
}

div.plot-panel
{
 border: 1px solid #EFF2EF;
 background-color: #FFFFFF;
 border-radius: 1%;
 display: inline-block;
 float: none;
 height: 350px;
 left: 600px;
 right: 0px;
 margin: 0px;
 position: absolute;
 top: 390px;
 width: 600px;
}

标签: javascriptplotlyplotly.js

解决方案


推荐阅读