/* * @Author: your name * @Date: 2021-10-12 15:14:58 * @LastEditTime: 2021-10-12 16:03:56 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: /data-show/src/views/BrandInsight/weiboPortraits/opt.js */ import * as echarts from "echarts"; export default function createOpt() { return { series: [ { name: 'Access From0', type: 'pie', radius: ['65%', '80%'], avoidLabelOverlap: false, label: { show: false, position: 'center', fontSize: '40', color: "#ffff", }, emphasis: { label: { show: true, fontSize: '40', color: "#ffff", formatter: (p)=>{ return p.data.name + '\n' + p.data.value; }, } }, labelLine: { show: false }, data: [ { value: 2200, name: '男性', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{ //给颜色设置渐变色 前面4个参数,给第一个设置1,第四个设置0 ,就是水平渐变 //给第一个设置0,第四个设置1,就是垂直渐变 offset: 0, color: 'black' }, { offset: 1, color: '#3373CC' }])} }, { value: 2200, name: '女性', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{ //给颜色设置渐变色 前面4个参数,给第一个设置1,第四个设置0 ,就是水平渐变 //给第一个设置0,第四个设置1,就是垂直渐变 offset: 0, color: 'black' }, { offset: 1, color: '#CC9D12' }])} }, { value: 2200, name: '未知', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{ //给颜色设置渐变色 前面4个参数,给第一个设置1,第四个设置0 ,就是水平渐变 //给第一个设置0,第四个设置1,就是垂直渐变 offset: 0, color: 'black' }, { offset: 1, color: '#54BF93' }])} }, ], }, { name: 'Access From1', type: 'pie', radius: ['86%', '94%'], avoidLabelOverlap: false, label: { show: false, position: 'center' }, labelLine: { show: false }, center: ['50%', '50%'],//边框位置 data: [ { value: 2200, name: '男性', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{ //给颜色设置渐变色 前面4个参数,给第一个设置1,第四个设置0 ,就是水平渐变 //给第一个设置0,第四个设置1,就是垂直渐变 offset: 0, color: 'black' }, { offset: 1, color: '#3373CC' }])} }, { value: 2200, name: '女性', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{ //给颜色设置渐变色 前面4个参数,给第一个设置1,第四个设置0 ,就是水平渐变 //给第一个设置0,第四个设置1,就是垂直渐变 offset: 0, color: 'black' }, { offset: 1, color: '#CC9D12' }])} }, { value: 2200, name: '未知', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{ //给颜色设置渐变色 前面4个参数,给第一个设置1,第四个设置0 ,就是水平渐变 //给第一个设置0,第四个设置1,就是垂直渐变 offset: 0, color: 'black' }, { offset: 1, color: '#54BF93' }])} }, ], } ] } }