pms-aomei/src/views/modules/pms/carHistory/components/configs/chart.js
2023-04-28 14:57:33 +08:00

70 lines
1.2 KiB
JavaScript

const colors = {
line: '#555'
}
export default (x_data, y_data) => ({
title: {
text: "窑车温度",
},
grid: {
show: true,
top: 96,
left: 52,
right: 32,
bottom: 24,
},
xAxis: {
type: "category",
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: '<strong style="font-size: 16px">位置</strong> ({b}) <span style="font-size: 16px; font-weight: bold;">{c}</span> ℃'
},
dataZoom: {
type: 'inside'
},
series: [
{
data: y_data,
// data: Array(65)
// .fill(1)
// .map((val) => Math.floor(Math.random() * 1000)),
type: "line",
},
],
})