首页 > 解决方案 > 对数y轴的plotly js范围

问题描述

是否可以在 10 之后不显示日志编号并显示下一个值,例如 20、30、40,需要类型的日志

问题

密码笔

var trace1 = {
  x: [1, 2, 3, 4, 5, 6, 7, 8],
  y: [1,10,20,40, 14, 12, 10, null, 15],
  mode: 'lines+markers',
  connectgaps: true
};

var trace2 = {
  x: [1, 2, 3, 4, 5, 6, 7, 8],
  y: [16, null, 13, 10, 8, null, 11, 12],
  mode: 'lines',
  connectgaps: true
};

var data = [trace1, trace2];

var layout = {
  title: 'Connect the Gaps Between Data',
  showlegend: false,
  yaxis: {
  type: 'log',
 }
};

Plotly.newPlot('myDiv', data, layout);

标签: javascriptd3.jsplotlyplotly.js

解决方案


推荐阅读