const colors = { line: '#555' } export default (x_data, y_data) => ({ title: { text: "窑车温度", }, grid: [ { id: 'temp-grid', show: true, top: 96, left: 56, right: 56, bottom: 32, }, { id: 'lambda-grid', top: 0, left: 0, right: 0, bottom: 0 } ], xAxis: [ { gridIndex: 0, id: 'temp-x-axis', type: "category", data: Array(65) .fill(1) .map((val, index) => { return val + index; }), axisLine: { lineStyle: { color: colors.line }, }, }, { gridIndex: 1, id: 'lambda-x-axis', data: Array(65) .fill(1) .map((val, index) => { return val + index; }), axisLine: { lineStyle: { color: colors.line } } } ], yAxis: { type: "value", name: "温度", nameTextStyle: { fontSize: 18, align: "right", verticalAlign: "bottom", lineHeight: 36, padding: 10, }, axisLine: { show: true, lineStyle: { color: colors.line, }, }, axisLabel: { formatter: '{value} ℃' }, splitLine: { lineStyle: { color: '#ddd' } }, }, tooltip: { trigger: 'axis', formatter: '位置 ({b}) {c} ℃' }, dataZoom: { type: 'inside' }, series: [ { data: y_data, // data: Array(65) // .fill(1) // .map((val) => Math.floor(Math.random() * 1000)), type: "line", }, ], })