描述
有一个绘制雷达图的需求,想着使用比较校的库,决定放弃echarts、highcharts这样体积比较有点大的库,采用了G2,发现使用过程中还依赖DataSet包,还是有点大,决定从G2迁到F2上面
code
<template>
<canvas
id="box"
ref="container"
class="box"
/>
</template>
<script>
import improveImage from '../images/xxxx.png'
let vm = null
export default {
props: {
//原始数据
origin: {
type: Array,
required: true
},
height: {
type: Number,
default: 350
},
width: {
type: Number,
default: 750
},
pointColor: {
type: String,
default: 'red'
}
},
data () {
return {
chart: null
}
},
watch: {
origin () {
this.refresh()
}
},
created () {
vm = this
},
mounted () {
this.refresh()
},
methods: {
refresh () {
if (this.chart) {
this.ch