不用UI也可获得的echarts超炫饼图体验(其实根本没有UI)🌚
先看效果图
这种样式的饼图要依赖echarts画圆环的功力,多画几个就有这种效果了
上代码
多圆环叠加之术😶
初始化一些参数
let echarts = require('echarts/lib/echarts')
let Chart1 = echarts.init(document.getElementById('pie_chart1'))
// 饼图开始
let chartTitle1 = '总数'
let chartLabel1 = ['有车', '没车']
let chartValue1 = [10, 15]
let innerNumber1 = 456
let chartData1 = []
for (let i = 0; i < chartLabel1.length; i++) {
chartData1.push({
name: chartLabel1[i],
value: chartValue1[i]
})
}
// 颜色取值列表,饼图渐变色解决方案
let colorList1 = [new echarts.graphic.LinearGradient(0, 0, 0, 1,
[
{ offset: 0, color: '#23bffe' }