/** * 图标配置参数 * */ /** * 1,收入与李荣 ------ 营业收入与通比增速 * years: 年份 * earning: 收入 * speed: 增速 * */ function income(intro, years, earning, speed) { return { tooltip: { trigger: 'axis', axisPointer: { // 坐标轴指示器,坐标轴触发有效 type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' } }, legend: { data: intro }, grid: { left: '0', right: '4%', bottom: '0', containLabel: true }, xAxis: [{ type: 'value' }], yAxis: [{ type: 'category', axisTick: { show: false }, data: years }], series: [{ name: intro[0], type: 'bar', label: { show: true }, data: earning }, { name: intro[1], type: 'bar', label: { show: true }, data: speed } ] } } /** * 2,营收构成 * */ function makeUp(data) { return { tooltip: { formatter: '{b}' }, legend: { type: 'scroll', bottom: 0, }, series: [{ type: 'pie', radius: '60%', center: ['50%', '50%'], data: data }] } } export { income, makeUp }