|
@@ -0,0 +1,208 @@
|
|
|
|
+<template>
|
|
|
|
+ <div :id="id" style="height: 250px;width: 300%"></div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+export default {
|
|
|
|
+ name: 'Lines',
|
|
|
|
+ props: {
|
|
|
|
+ id: String
|
|
|
|
+ },
|
|
|
|
+ data(){
|
|
|
|
+ return {
|
|
|
|
+ myChart: null,
|
|
|
|
+ datax:[1,23,4,5,24,342,432,7,2,3,44,52,23,121,21,55,67,2,37,99,12,66,12,89,27],
|
|
|
|
+ option: {
|
|
|
|
+ tooltip: {
|
|
|
|
+ trigger: 'axis',
|
|
|
|
+ },
|
|
|
|
+ //添加标题
|
|
|
|
+ title: {
|
|
|
|
+ bottom: 0,
|
|
|
|
+ left: 'center',
|
|
|
|
+ textStyle: {
|
|
|
|
+ fontSize: 14,
|
|
|
|
+ fontWeight: 'normal',
|
|
|
|
+ color: '#303133',
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ legend: {
|
|
|
|
+ left: 'right',
|
|
|
|
+ icon: 'rect',
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: '#000'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ xAxis: [
|
|
|
|
+ {
|
|
|
|
+ data: [
|
|
|
|
+ // '2021-09-01 00:00:00',
|
|
|
|
+ '2021-09-01 01:00:00',
|
|
|
|
+ '2021-09-01 02:00:00',
|
|
|
|
+ '2021-09-01 03:00:00',
|
|
|
|
+ '2021-09-01 04:00:00',
|
|
|
|
+ '2021-09-01 05:00:00',
|
|
|
|
+ '2021-09-01 06:00:00',
|
|
|
|
+ '2021-09-01 07:00:00',
|
|
|
|
+ '2021-09-01 08:00:00',
|
|
|
|
+ '2021-09-01 09:00:00',
|
|
|
|
+ '2021-09-01 10:00:00',
|
|
|
|
+ '2021-09-01 11:00:00',
|
|
|
|
+ '2021-09-01 12:00:00',
|
|
|
|
+ '2021-09-01 13:00:00',
|
|
|
|
+ '2021-09-01 14:00:00',
|
|
|
|
+ '2021-09-01 15:00:00',
|
|
|
|
+ '2021-09-01 16:00:00',
|
|
|
|
+ '2021-09-01 17:00:00',
|
|
|
|
+ '2021-09-01 18:00:00',
|
|
|
|
+ '2021-09-01 19:00:00',
|
|
|
|
+ '2021-09-01 21:00:00',
|
|
|
|
+ '2021-09-01 22:00:00',
|
|
|
|
+ '2021-09-01 23:00:00',
|
|
|
|
+ '2021-09-01 24:00:00',
|
|
|
|
+ // '2021-09-02 00:00:00',
|
|
|
|
+ '2021-09-02 01:00:00',
|
|
|
|
+ '2021-09-02 02:00:00',
|
|
|
|
+ '2021-09-02 03:00:00',
|
|
|
|
+ '2021-09-02 04:00:00',
|
|
|
|
+ '2021-09-02 05:00:00',
|
|
|
|
+ ],
|
|
|
|
+ type: 'category',
|
|
|
|
+ axisTick: {
|
|
|
|
+ //是否显示坐标刻度
|
|
|
|
+ show: false,
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#DCDFE6',
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: '#303133',
|
|
|
|
+ fontSize: '12',
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ yAxis: [
|
|
|
|
+ {
|
|
|
|
+ name: '',
|
|
|
|
+ nameTextStyle: {
|
|
|
|
+ color: '#909399',
|
|
|
|
+ align: 'right',
|
|
|
|
+ fontSize: 12,
|
|
|
|
+ },
|
|
|
|
+ minInterval: 1,
|
|
|
|
+ min: 0,
|
|
|
|
+ type: 'value',
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: '#606266',
|
|
|
|
+ fontSize: '12',
|
|
|
|
+ lineHeight: '12',
|
|
|
|
+ },
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: false, //不显示网格分割线
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ show: false, //不显示y轴线
|
|
|
|
+ },
|
|
|
|
+ axisTick: {
|
|
|
|
+ //是否显示坐标刻度
|
|
|
|
+ show: false,
|
|
|
|
+ },
|
|
|
|
+ // splitArea: {
|
|
|
|
+ // show: true,
|
|
|
|
+ // areaStyle: {
|
|
|
|
+ // color: ['#F2F6FC', 'transparent'],
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ grid: { top: '15%', bottom: '20%', left: '5%', right: '5%' },
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ type: 'line',
|
|
|
|
+ data: [1,23,4,5,24,342,432,7,2,3,44,52,23,121,21,55,67,2,37,99,12,66,12,89,27],
|
|
|
|
+ itemStyle: { color: '#409eff' },
|
|
|
|
+ yAxisIndex: 0,
|
|
|
|
+ name: '自动割煤',
|
|
|
|
+ // 图表标域,常用于标记图表中某个范围的数据,例如标出某段时间投放了广告。
|
|
|
|
+ markArea: {
|
|
|
|
+ data: [
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ name: '晚班',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#282A39'
|
|
|
|
+ },
|
|
|
|
+ xAxis: '2021-09-01 00:00:00'
|
|
|
|
+ }, {
|
|
|
|
+ xAxis: '2021-09-01 08:00:00'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ name: '早班',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#303845'
|
|
|
|
+ },
|
|
|
|
+ xAxis: '2021-09-01 08:00:00'
|
|
|
|
+ }, {
|
|
|
|
+ xAxis: '2021-09-01 16:00:00'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ name: '中班',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#303845'
|
|
|
|
+ },
|
|
|
|
+ xAxis: '2021-09-01 16:00:00'
|
|
|
|
+ }, {
|
|
|
|
+ xAxis: '2021-09-01 24:00:00'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ name: '晚班',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#282A39'
|
|
|
|
+ },
|
|
|
|
+ xAxis: '2021-09-01 24:00:00'
|
|
|
|
+ }, {
|
|
|
|
+ xAxis: '2021-09-02 05:00:00'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ ],
|
|
|
|
+ itemStyle: { color: '#f0b1f0' },
|
|
|
|
+ label: { color: '#f0b1f0' },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: 'line',
|
|
|
|
+ data: [23,12,123,114,133,122,89,939,7,24,242,532,123,14,15,224,7,2,3,434,152,23,21,211,88],
|
|
|
|
+ itemStyle: { color: '#EEEF00' },
|
|
|
|
+ yAxisIndex: 0,
|
|
|
|
+ name: '手动割煤',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created(){
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ this.myChart = this.$echarts.init(document.getElementById(this.id));
|
|
|
|
+ this.setLine();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ setLine() {
|
|
|
|
+ this.myChart.setOption(this.option)
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style>
|
|
|
|
+
|
|
|
|
+</style>
|