parent
050d776cd8
commit
e3f08837b1
@ -1,195 +1,195 @@
|
|||||||
// * echarts 初始化方法
|
// // * echarts 初始化方法
|
||||||
import * as echarts from 'echarts'
|
// import * as echarts from 'echarts'
|
||||||
import EleResize from '@/utils/esresize'
|
// import EleResize from '@/utils/esresize'
|
||||||
export const init_echarts = () => {
|
// export const init_echarts = () => {
|
||||||
// * echarts 实例
|
// // * echarts 实例
|
||||||
const myChart = echarts.init(document.getElementById('people_chart'))
|
// const myChart = echarts.init(document.getElementById('people_chart'))
|
||||||
let resize_div = document.getElementById('people_chart')
|
// let resize_div = document.getElementById('people_chart')
|
||||||
// *echarts表自适应
|
// // *echarts表自适应
|
||||||
EleResize.on(resize_div, () => {
|
// EleResize.on(resize_div, () => {
|
||||||
myChart.resize()
|
// myChart.resize()
|
||||||
})
|
// })
|
||||||
// * echarts 选项
|
// // * echarts 选项
|
||||||
myChart.setOption({
|
// myChart.setOption({
|
||||||
color: ['#80ffa5', '#00ddff', '#37a2ff', '#ffbf00'],
|
// color: ['#80ffa5', '#00ddff', '#37a2ff', '#ffbf00'],
|
||||||
title: {
|
// title: {
|
||||||
// text: '标题'
|
// // text: '标题'
|
||||||
},
|
// },
|
||||||
tooitip: {
|
// tooitip: {
|
||||||
trigger: 'axis',
|
// trigger: 'axis',
|
||||||
axisPointer: {
|
// axisPointer: {
|
||||||
type: 'cross',
|
// type: 'cross',
|
||||||
label: {
|
// label: {
|
||||||
backgroundColor: '#6a7985'
|
// backgroundColor: '#6a7985'
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
legend: {
|
// legend: {
|
||||||
// data: ['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5']
|
// // data: ['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5']
|
||||||
},
|
// },
|
||||||
toolbox: {
|
// toolbox: {
|
||||||
feature: {
|
// feature: {
|
||||||
saveAsImage: {}
|
// saveAsImage: {}
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
grid: {
|
// grid: {
|
||||||
left: '3%',
|
// left: '3%',
|
||||||
right: '4%',
|
// right: '4%',
|
||||||
bottom: '3%',
|
// bottom: '3%',
|
||||||
containLabel: true
|
// containLabel: true
|
||||||
},
|
// },
|
||||||
xAxis: [
|
// xAxis: [
|
||||||
{
|
// {
|
||||||
type: 'category',
|
// type: 'category',
|
||||||
boundaryGap: false,
|
// boundaryGap: false,
|
||||||
data: ['11-26', '11-27', '11-28', '11-29', '11-30', '12-01', '12-02']
|
// data: ['11-26', '11-27', '11-28', '11-29', '11-30', '12-01', '12-02']
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
yAxis: [
|
// yAxis: [
|
||||||
{
|
// {
|
||||||
type: 'value'
|
// type: 'value'
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
series: [
|
// series: [
|
||||||
{
|
// {
|
||||||
// name: 'Line 1',
|
// // name: 'Line 1',
|
||||||
type: 'line',
|
// type: 'line',
|
||||||
stack: 'Total',
|
// stack: 'Total',
|
||||||
smooth: true,
|
// smooth: true,
|
||||||
lineStyle: {
|
// lineStyle: {
|
||||||
width: 0
|
// width: 0
|
||||||
},
|
// },
|
||||||
showSymbol: false,
|
// showSymbol: false,
|
||||||
areaStyle: {
|
// areaStyle: {
|
||||||
opacity: 0.8,
|
// opacity: 0.8,
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{
|
// {
|
||||||
offset: 0,
|
// offset: 0,
|
||||||
color: 'rgb(128, 255, 165)'
|
// color: 'rgb(128, 255, 165)'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
offset: 1,
|
// offset: 1,
|
||||||
color: 'rgb(1, 191, 236)'
|
// color: 'rgb(1, 191, 236)'
|
||||||
}
|
// }
|
||||||
])
|
// ])
|
||||||
},
|
// },
|
||||||
emphasis: {
|
// emphasis: {
|
||||||
focus: 'series'
|
// focus: 'series'
|
||||||
},
|
// },
|
||||||
data: [140, 232, 101, 264, 90, 340, 250]
|
// data: [140, 232, 101, 264, 90, 340, 250]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
// name: 'Line 2',
|
// // name: 'Line 2',
|
||||||
type: 'line',
|
// type: 'line',
|
||||||
stack: 'Total',
|
// stack: 'Total',
|
||||||
smooth: true,
|
// smooth: true,
|
||||||
lineStyle: {
|
// lineStyle: {
|
||||||
width: 0
|
// width: 0
|
||||||
},
|
// },
|
||||||
showSymbol: false,
|
// showSymbol: false,
|
||||||
areaStyle: {
|
// areaStyle: {
|
||||||
opacity: 0.8,
|
// opacity: 0.8,
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{
|
// {
|
||||||
offset: 0,
|
// offset: 0,
|
||||||
color: 'rgb(0, 221, 255)'
|
// color: 'rgb(0, 221, 255)'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
offset: 1,
|
// offset: 1,
|
||||||
color: 'rgb(77, 119, 255)'
|
// color: 'rgb(77, 119, 255)'
|
||||||
}
|
// }
|
||||||
])
|
// ])
|
||||||
},
|
// },
|
||||||
emphasis: {
|
// emphasis: {
|
||||||
focus: 'series'
|
// focus: 'series'
|
||||||
},
|
// },
|
||||||
data: [120, 282, 111, 234, 220, 340, 310]
|
// data: [120, 282, 111, 234, 220, 340, 310]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
// name: 'Line 3',
|
// // name: 'Line 3',
|
||||||
type: 'line',
|
// type: 'line',
|
||||||
stack: 'Total',
|
// stack: 'Total',
|
||||||
smooth: true,
|
// smooth: true,
|
||||||
lineStyle: {
|
// lineStyle: {
|
||||||
width: 0
|
// width: 0
|
||||||
},
|
// },
|
||||||
showSymbol: false,
|
// showSymbol: false,
|
||||||
areaStyle: {
|
// areaStyle: {
|
||||||
opacity: 0.8,
|
// opacity: 0.8,
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{
|
// {
|
||||||
offset: 0,
|
// offset: 0,
|
||||||
color: 'rgb(55, 162, 255)'
|
// color: 'rgb(55, 162, 255)'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
offset: 1,
|
// offset: 1,
|
||||||
color: 'rgb(116, 21, 219)'
|
// color: 'rgb(116, 21, 219)'
|
||||||
}
|
// }
|
||||||
])
|
// ])
|
||||||
},
|
// },
|
||||||
emphasis: {
|
// emphasis: {
|
||||||
focus: 'series'
|
// focus: 'series'
|
||||||
},
|
// },
|
||||||
data: [320, 132, 201, 334, 190, 130, 220]
|
// data: [320, 132, 201, 334, 190, 130, 220]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
// name: 'Line 4',
|
// // name: 'Line 4',
|
||||||
type: 'line',
|
// type: 'line',
|
||||||
stack: 'Total',
|
// stack: 'Total',
|
||||||
smooth: true,
|
// smooth: true,
|
||||||
lineStyle: {
|
// lineStyle: {
|
||||||
width: 0
|
// width: 0
|
||||||
},
|
// },
|
||||||
showSymbol: false,
|
// showSymbol: false,
|
||||||
areaStyle: {
|
// areaStyle: {
|
||||||
opacity: 0.8,
|
// opacity: 0.8,
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{
|
// {
|
||||||
offset: 0,
|
// offset: 0,
|
||||||
color: 'rgb(255, 0, 135)'
|
// color: 'rgb(255, 0, 135)'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
offset: 1,
|
// offset: 1,
|
||||||
color: 'rgb(135, 0, 157)'
|
// color: 'rgb(135, 0, 157)'
|
||||||
}
|
// }
|
||||||
])
|
// ])
|
||||||
},
|
// },
|
||||||
emphasis: {
|
// emphasis: {
|
||||||
focus: 'series'
|
// focus: 'series'
|
||||||
},
|
// },
|
||||||
data: [220, 402, 231, 134, 190, 230, 120]
|
// data: [220, 402, 231, 134, 190, 230, 120]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
// name: 'Line 5',
|
// // name: 'Line 5',
|
||||||
type: 'line',
|
// type: 'line',
|
||||||
stack: 'Total',
|
// stack: 'Total',
|
||||||
smooth: true,
|
// smooth: true,
|
||||||
lineStyle: {
|
// lineStyle: {
|
||||||
width: 0
|
// width: 0
|
||||||
},
|
// },
|
||||||
showSymbol: false,
|
// showSymbol: false,
|
||||||
label: {
|
// label: {
|
||||||
show: true,
|
// show: true,
|
||||||
position: 'top'
|
// position: 'top'
|
||||||
},
|
// },
|
||||||
areaStyle: {
|
// areaStyle: {
|
||||||
opacity: 0.8,
|
// opacity: 0.8,
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{
|
// {
|
||||||
offset: 0,
|
// offset: 0,
|
||||||
color: 'rgb(255, 191, 0)'
|
// color: 'rgb(255, 191, 0)'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
offset: 1,
|
// offset: 1,
|
||||||
color: 'rgb(224, 62, 76)'
|
// color: 'rgb(224, 62, 76)'
|
||||||
}
|
// }
|
||||||
])
|
// ])
|
||||||
},
|
// },
|
||||||
emphasis: {
|
// emphasis: {
|
||||||
focus: 'series'
|
// focus: 'series'
|
||||||
},
|
// },
|
||||||
data: [220, 302, 181, 234, 210, 290, 150]
|
// data: [220, 302, 181, 234, 210, 290, 150]
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
Loading…
Reference in new issue