| | |
| | | <template> |
| | | <div class="chart-container" :style="getStyle" > |
| | | <div class="chart-content-container" |
| | | <div class="chart-container" :style="getStyle"> |
| | | <div class="chart-content-container" |
| | | @mouseenter="mouseEnter" |
| | | @mouseleave="mouseLeave" |
| | | :class="{'chart-content-fixed':isFull}"> |
| | | <div class="chart-content" :id="id"></div> |
| | | <!-- <div class="chart-tools"> |
| | |
| | | end: dataZoom.end, |
| | | xAxisIndex: [0], |
| | | realtime: false, |
| | | left: '0', |
| | | right: '8px', |
| | | dataBackground: { |
| | | lineStyle: { |
| | | color: '#15E3F3' |
| | | }, |
| | | areaStyle: { |
| | | color: '#15E3F3' |
| | | color: '#15E3F3', |
| | | opacity: 0, |
| | | } |
| | | }, |
| | | }, |
| | |
| | | this.chart.resize(); |
| | | }); |
| | | }, |
| | | mouseEnter() { |
| | | if(!this.showZoom) { |
| | | return false; |
| | | } |
| | | // 绘制图表 |
| | | this.chart.setOption({ |
| | | grid: { |
| | | bottom: '40px', |
| | | }, |
| | | dataZoom: [{ |
| | | show: true, |
| | | }] |
| | | }); |
| | | }, |
| | | mouseLeave() { |
| | | if(!this.showZoom) { |
| | | return false; |
| | | } |
| | | this.dataZoom.show = false; |
| | | // 绘制图表 |
| | | this.chart.setOption({ |
| | | grid: { |
| | | bottom: '1', |
| | | }, |
| | | dataZoom: [{ |
| | | show: false, |
| | | }] |
| | | }); |
| | | }, |
| | | }, |
| | | computed: { |
| | | getStyle(){ |
| | |
| | | :title="option.title" |
| | | :height="option.height" |
| | | :zoom="false" |
| | | :show-zoom="option.showZoom" |
| | | :show-zoom="true" |
| | | :end="4"></line-chart> |
| | | </div> |
| | | </template> |
| | |
| | | return this.showChartTitle.join(','); |
| | | }, |
| | | getTableName() { |
| | | return new Date(this.record_time).format("yyyy-MM-dd")+'-' |
| | | +new Date(this.record_time1).format("yyyy-MM-dd"); |
| | | let start = new Date(this.record_time).format("yyyy-MM-dd"); |
| | | let end = new Date(this.record_time1).format("yyyy-MM-dd"); |
| | | return start==end?start:start+'-'+end; |
| | | }, |
| | | }, |
| | | mounted() { |