|
@ -1,6 +1,6 @@ |
|
|
import * as echarts from "echarts"; |
|
|
import * as echarts from "echarts"; |
|
|
|
|
|
|
|
|
export default function optionFn() { |
|
|
export default function optionFn(myChart) { |
|
|
return { |
|
|
return { |
|
|
// title: {
|
|
|
// title: {
|
|
|
// text: "事件类型",
|
|
|
// text: "事件类型",
|
|
@ -15,49 +15,90 @@ export default function optionFn() { |
|
|
// tooltip: {
|
|
|
// tooltip: {
|
|
|
// show: true,
|
|
|
// show: true,
|
|
|
// },
|
|
|
// },
|
|
|
animationDurationUpdate: 300, |
|
|
|
|
|
|
|
|
|
|
|
legend: { |
|
|
grid: { |
|
|
type: "scroll", |
|
|
top: "20%", |
|
|
orient: "vertical", |
|
|
left: "3%", |
|
|
right: 0, |
|
|
right: "3%", |
|
|
top: 20, |
|
|
bottom: "10%", |
|
|
bottom: 20, |
|
|
containLabel: true, |
|
|
itemWidth: 8, |
|
|
|
|
|
itemHeight: 8, |
|
|
|
|
|
textStyle: { |
|
|
|
|
|
color: "rgba(181, 217, 255, 0.75)", |
|
|
|
|
|
}, |
|
|
|
|
|
// data: [],
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
tooltip: { |
|
|
|
|
|
trigger: "item", |
|
|
|
|
|
}, |
|
|
|
|
|
animationDurationUpdate: 300, |
|
|
|
|
|
|
|
|
|
|
|
// legend: {
|
|
|
|
|
|
// type: "scroll",
|
|
|
|
|
|
// orient: "vertical",
|
|
|
|
|
|
// right: 0,
|
|
|
|
|
|
// top: 20,
|
|
|
|
|
|
// bottom: 20,
|
|
|
|
|
|
// itemWidth: 8,
|
|
|
|
|
|
// itemHeight: 8,
|
|
|
|
|
|
// textStyle: {
|
|
|
|
|
|
// color: "rgba(181, 217, 255, 0.75)",
|
|
|
|
|
|
// },
|
|
|
|
|
|
// // data: [],
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
series: [ |
|
|
series: [ |
|
|
{ |
|
|
{ |
|
|
name: "特殊人群分类", |
|
|
name: "", |
|
|
type: "pie", |
|
|
type: "pie", |
|
|
radius: ["50%", "80%"], |
|
|
radius: ["35%", "55%"], |
|
|
center: ["30%", "50%"], |
|
|
center: ["50%", "50%"], |
|
|
avoidLabelOverlap: false, |
|
|
avoidLabelOverlap: false, |
|
|
|
|
|
|
|
|
label: { |
|
|
label: { |
|
|
show: false, |
|
|
show: true, |
|
|
position: "center", |
|
|
// position: "center",
|
|
|
|
|
|
|
|
|
formatter(n, s) { |
|
|
// formatter(n, s) {
|
|
|
console.log(n, s); |
|
|
// console.log(n, s);
|
|
|
return n.data.name + ":" + n.data.value; |
|
|
// return n.data.name + ":" + n.data.value;
|
|
|
|
|
|
// },
|
|
|
|
|
|
formatter: '{name|{b}}\n{value|{c} 人}', |
|
|
|
|
|
|
|
|
|
|
|
alignTo: "edge", |
|
|
|
|
|
minMargin: 5, |
|
|
|
|
|
edgeDistance: 10, |
|
|
|
|
|
lineHeight: 15, |
|
|
|
|
|
rich: { |
|
|
|
|
|
value: { |
|
|
|
|
|
fontSize: 10, |
|
|
|
|
|
color: "#999", |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
labelLine: { |
|
|
|
|
|
length: 15, |
|
|
|
|
|
length2: 0, |
|
|
|
|
|
maxSurfaceAngle: 80, |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
labelLayout: function (params) { |
|
|
|
|
|
const isLeft = params.labelRect.x < myChart.getWidth() / 2; |
|
|
|
|
|
const points = params.labelLinePoints; |
|
|
|
|
|
// Update the end point.
|
|
|
|
|
|
points[2][0] = isLeft |
|
|
|
|
|
? params.labelRect.x |
|
|
|
|
|
: params.labelRect.x + params.labelRect.width; |
|
|
|
|
|
return { |
|
|
|
|
|
labelLinePoints: points, |
|
|
|
|
|
}; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
emphasis: { |
|
|
emphasis: { |
|
|
label: { |
|
|
label: { |
|
|
show: true, |
|
|
show: true, |
|
|
fontSize: 14, |
|
|
fontSize: 14, |
|
|
fontWeight: 'bold', |
|
|
fontWeight: "bold", |
|
|
color:'#fff', |
|
|
color: "#fff", |
|
|
formatter:'{d}%' |
|
|
formatter: "{d}%", |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
labelLine: { |
|
|
|
|
|
show: false, |
|
|
|
|
|
}, |
|
|
}, |
|
|
itemStyle: { |
|
|
itemStyle: { |
|
|
normal: { |
|
|
normal: { |
|
|