1、要实现的效果如下图:

2、首先项目中引用vue2-highcharts
package.json中如下:

在命令行中输入:
cnpm install vue2-highcharts3、页面代码如下:
<template>
<div >
<div>
<div id="transparent-header" class="rank-head container" >
<img src="../assets/index/back.png" class="rank-head-back" @click="routerBack"/>
<span >用能排名</span>
</div>
</div>
<div >
<div >
<datepicker v-on:picked="picked" style="margin-left:10px;"></datepicker>
</div>
<div >
</div>
</div>
<div >
<div class="charts">
<vue-highcharts :options="options" ref="maxLineCharts"></vue-highcharts>
</div>
</div>
<div >
<div class="charts">
<vue-highcharts :options="options" ref="minLineCharts"></vue-highcharts>
</div>
</div>
</div>
</template>
<script>
import datepicker from '../components/datepicker.vue'
import VueHighcharts from 'vue2-highcharts'
export default {
data() {
return{
topHeight:240,
freezeMon:'',
ownerFreeData: [],
options:{
credits: {
enabled: false
},
legend: {
enabled: false
},
global: {
useUTC: false
},
chart: {
type: 'bar'
},
title: {
text: ' '
},
subtitle: {
text: ''
},
xAxis:[{
categories: ['1', '2', '3', '4', '5','6', '7', '8', '9', '10'],
title: {
text: null
},
labels: {
rotation: -45
}
}],
yAxis:[{
min: 0,
labels:{
overflow: 'justify'
},
title: {
text: '单位 (kwh)',
align: 'high'
}
}],
tooltip: {
formatter: function(){
return this.x+':'+this.y+'kwh';
}
},
credits: {
enabled: false
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
},
series: [{
type: 'bar'
}] }
}
}
},
methods: {
picked(year, month, date) {
if(month < 10){










