<template>
<div id="MainContent">
</div>
</template>
<script>
const echarts= require('echarts');
export default {
data() {
return {
option : {
tooltip: {
formatter: '{a} <br/>{b} : {c}%'
},
series: [{
name: 'Pressure',
type: 'gauge',
detail: {
formatter: '{value}'
},
data: [{
value: 50,
name: 'SCORE'
}]
}]
}
};
},
mounted() {
// 初始化echarts 并且绑定标签
var myChart = echarts.init(document.getElementById("MainContent"));
//设置参数
myChart.setOption(this.option, true);
},
methods: {
text (s){
var that=this;
var nowtime=new Date().getTime();
console.log("========="+nowtime);
axios({
method: 'get',
url: 'https://6816bec0.cpolar.cn/test',
params: {
timestamp:nowtime
}
})
}
}
}
</script>
<style scoped>
div{
width: 500px;
height: 500px;
}
</style>