<!-- * @Description: 管线附属物数量统计图 * @Author: 王晓颖 * @Date: 2020-09-04 15:15:51 --> <template> <chart-layout title="管线附属物" @click="getData"> <div style="width: 100%;height:100%;padding:0.1rem"> <colorful-bar-chart :id="options.id" :unit="options.unit" :height="options.height" :xAxisData="options.xAxisData" :seriesData="options.seriesData" /> </div> <corner1 slot="corner"/> </chart-layout> </template> <script> import ColorfulBarChart from '@/components/barChart/colorfulBarChart' import ChartLayout from '@/components/layout/chartLayout' import {fetchPipeCount} from '@/api/cityManage' export default { name: 'pipeAppendageBar', components: {ChartLayout, ColorfulBarChart}, data () { return { options: { id: 'pipe_appendage_count_bar', height: '100%', width: '100%', unit: '米', xAxisData: ['给水', '雨水', '污水', '燃气', '路灯', '供电', '交通信号', '电信', '移动'], seriesData: [234, 1138, 339, 37, 2141, 294, 132, 152, 3 ] } } }, created () { this.getData() }, methods: { getData () { // fetchPipeCount().then(response => { // if (response.code === 200) { // const data = response.data // this.options.xAxisData = data.map(item => { return item.name }) // this.options.seriesData = data.map(item => { return item.value }) // } // }) } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> </style>