1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| <template> <div class="radarGraph"> <HighCharts :options="options" class="radar" ></HighCharts> </div> </template> <script>
export default { name: 'RadarGraph', computed: { gameInfo () { return this.$store.state.gameInfo }, options () { return {
chart: { polar: true, type: 'line', marginTop: 0, marginBottom: 0, marginLeft: 0, marginRight: 0 },
credits: { enabled: false },
pane: { size: '75%' },
title: null,
legend: { enabled: false },
xAxis: { categories: ['分类1', '分类2', '分类3', '分类4', '分类5', '分类6' ], labels: { style: { fontSize: '14px' } }, tickmarkPlacement: 'on', lineWidth: 0 },
yAxis: { gridLineInterpolation: 'polygon', lineWidth: 0, min: 0 },
series: [{ type: 'area', name: '得分', data: [this.gameInfo.radar1, this.gameInfo.radar2, this.gameInfo.radar3, this.gameInfo.radar4, this.gameInfo.radar5, this.gameInfo.radar6], pointPlacement: 'on' }] } }, ...mapGetters([ 'userId' ]) }, created () { this.fetchData() }, methods: { fetchData () { this.$store.dispatch('GetGameInfo', this.userId) } } }
</script>
|