| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <div>
- <div id="chart" style="width:100%;height:85%"></div>
- </div>
- </template>
- <script>
- import echarts from 'echarts'
- export default {
- data() {
- return {
- // title:'人员培训',
- dialogOff:false,
- }
- },
- props:{
- data: {
- type: Array,
- default: []
- }
- },
- watch: {
- data(v) {
- this.getEchartData()
- }
- },
- mounted() {
- this.getEchartData()
- },
- methods: {
- getEchartData() {
- if (true) {
- let myChart = echarts.init(document.getElementById("chart"))
- let option = {
- legend: {
- textStyle:{
- color:'#fff'
- }
- },
- tooltip: {},
- color:['#FF3366','#66FFFF','#66CC00'],
- dataset: {
- dimensions: ['lei_bie_', 'qznum', 'ynnum', 'khnum'],
- source: this.data
- },
- xAxis: {
- type: 'category',
- axisLabel:{//修改坐标系字体颜色
- show:true,
- textStyle:{
- color:"#fff"
- }
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "rgba(255,255,255,1)",
- type: "solid"
- }
- }
- },
- yAxis: {
- axisLabel:{//修改坐标系字体颜色
- show:true,
- textStyle:{
- color:"#fff"
- }
- },
- axisLine: {//y轴线的颜色以及宽度
- show: true,
- lineStyle: {
- color: "rgba(255,255,255,1)",
- type: "solid"
- },
- },
- splitLine: {
- show: false
- }
- },
- // Declare several bar series, each will be mapped
- // to a column of dataset.source by default.
- series: [
- {
- name: '潜在客户数量',
- type: 'bar',
- label: {
- show: true,
- position: 'top'
- }
- }, {
- name: '意向客户数量',
- type: 'bar',
- label: {
- show: true,
- position: 'top'
- }
- }, {
- name: '已签约客户数量',
- type: 'bar',
- label: {
- show: true,
- position: 'top'
- }
- }
- ]
- };
- option && myChart.setOption(option);
- }
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- </style>
|