index.vue
1.99 KB
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
<template>
<div class="chart-container app-container nohead">
<el-alert title="免责声明:Highcharts组件不属于NCC产品,只用于介绍第三方组件如何在《NCC快速开发平台》中使用。如果对这些组件感兴趣,请使用正版。"
type="warning" :closable="false" class="mb-10" />
<highcharts :options="chartOptions" :callback="myCallback"
style="height:530px;margin-top:30px;"></highcharts>
</div>
</template>
<script>
import { Chart } from "highcharts-vue";
import Highcharts from 'highcharts';
import highchartsFunnel from 'highcharts/modules/funnel'
highchartsFunnel(Highcharts)
export default {
name: 'extend-graphDemo-highchartsFunnel',
components: {
highcharts: Chart
},
data() {
return {
chartOptions: {
chart: {
type: 'funnel',
marginRight: 100
},
title: {
text: '销售漏斗',
x: -50
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
crop: false,
overflow: 'none',
format: '<b>{point.name}</b> ({point.y:,.0f})',
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black',
softConnector: true
},
neckWidth: '30%',
neckHeight: '25%'
//-- Other available options
// height: pixels or percent
// width: pixels or percent
}
},
legend: {
enabled: false
},
credits: {
enabled: false
},
series: [{
name: '用户',
data: [
['访问网站', 9654],
['下载产品', 4064],
['询价', 2987],
['商定', 1976],
['发送合同', 987],
['成交', 846]
]
}]
}
}
},
mounted() { },
methods: {
myCallback() {
console.log("this is callback function");
}
}
}
</script>