fix: 去除echart折线图横轴自定义时间,使用默认时间
This commit is contained in:
@@ -177,15 +177,15 @@ export const stackedLineChartOption = {
|
|||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
type: 'time',
|
type: 'time',
|
||||||
splitNumber: 12,
|
splitNumber: 12
|
||||||
axisLabel: {
|
// axisLabel: {
|
||||||
formatter: function (value) {
|
// formatter: function (value) {
|
||||||
const data = new Date(value)
|
// const data = new Date(value)
|
||||||
const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
// const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
||||||
const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
// const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
||||||
return h + ':' + m
|
// return h + ':' + m
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
yAxis: [
|
yAxis: [
|
||||||
@@ -234,15 +234,15 @@ export const linkTrafficLineChartOption = {
|
|||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
type: 'time',
|
type: 'time',
|
||||||
splitNumber: 12,
|
splitNumber: 12
|
||||||
axisLabel: {
|
// axisLabel: {
|
||||||
formatter: function (value) {
|
// formatter: function (value) {
|
||||||
const data = new Date(value)
|
// const data = new Date(value)
|
||||||
const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
// const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
||||||
const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
// const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
||||||
return h + ':' + m
|
// return h + ':' + m
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
yAxis: [
|
yAxis: [
|
||||||
@@ -326,15 +326,16 @@ export const npmLineChartOption = {
|
|||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
type: 'time',
|
type: 'time',
|
||||||
splitNumber: 8,
|
splitNumber: 8
|
||||||
axisLabel: {
|
// axisLabel: {
|
||||||
formatter: function (value) {
|
// formatter: function (value) {
|
||||||
const data = new Date(value)
|
// const data = new Date(value)
|
||||||
const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
// const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
||||||
const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
// const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
||||||
return h + ':' + m
|
// console.log(h + ':' + m)
|
||||||
}
|
// return h + ':' + m
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
yAxis: [
|
yAxis: [
|
||||||
@@ -397,15 +398,15 @@ export const trafficLineChartOption = {
|
|||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
type: 'time',
|
type: 'time',
|
||||||
splitNumber: 12,
|
splitNumber: 12
|
||||||
axisLabel: {
|
// axisLabel: {
|
||||||
formatter: function (value) {
|
// formatter: function (value) {
|
||||||
const data = new Date(value)
|
// const data = new Date(value)
|
||||||
const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
// const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
||||||
const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
// const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
||||||
return h + ':' + m
|
// return h + ':' + m
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
yAxis: [
|
yAxis: [
|
||||||
@@ -493,16 +494,16 @@ export const stackedBarChartOption = {
|
|||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
margin: 12,
|
|
||||||
formatter: function (value) {
|
|
||||||
const data = new Date(value)
|
|
||||||
const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
|
||||||
const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
|
||||||
return h + ':' + m
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// axisLabel: {
|
||||||
|
// margin: 12,
|
||||||
|
// formatter: function (value) {
|
||||||
|
// const data = new Date(value)
|
||||||
|
// const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours()
|
||||||
|
// const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes()
|
||||||
|
// return h + ':' + m
|
||||||
|
// }
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
|
|||||||
Reference in New Issue
Block a user