|
|
|
@ -92,98 +92,98 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 标题修改
|
|
|
|
|
setOptionsTitle() {
|
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
const title = {};
|
|
|
|
|
title.text = optionsCollapse.titleText;
|
|
|
|
|
title.show = optionsCollapse.isNoTitle;
|
|
|
|
|
title.left = optionsCollapse.textAlign;
|
|
|
|
|
title.text = optionsSetup.titleText;
|
|
|
|
|
title.show = optionsSetup.isNoTitle;
|
|
|
|
|
title.left = optionsSetup.textAlign;
|
|
|
|
|
title.textStyle = {
|
|
|
|
|
color: optionsCollapse.textColor,
|
|
|
|
|
fontSize: optionsCollapse.textFontSize,
|
|
|
|
|
fontWeight: optionsCollapse.textFontWeight
|
|
|
|
|
color: optionsSetup.textColor,
|
|
|
|
|
fontSize: optionsSetup.textFontSize,
|
|
|
|
|
fontWeight: optionsSetup.textFontWeight
|
|
|
|
|
};
|
|
|
|
|
title.subtext = optionsCollapse.subText;
|
|
|
|
|
title.subtext = optionsSetup.subText;
|
|
|
|
|
title.subtextStyle = {
|
|
|
|
|
color: optionsCollapse.subTextColor,
|
|
|
|
|
fontWeight: optionsCollapse.subTextFontWeight,
|
|
|
|
|
fontSize: optionsCollapse.subTextFontSize
|
|
|
|
|
color: optionsSetup.subTextColor,
|
|
|
|
|
fontWeight: optionsSetup.subTextFontWeight,
|
|
|
|
|
fontSize: optionsSetup.subTextFontSize
|
|
|
|
|
};
|
|
|
|
|
this.options.title = title;
|
|
|
|
|
},
|
|
|
|
|
// 数值设定
|
|
|
|
|
setOptionsValue() {
|
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
const series = this.options.series;
|
|
|
|
|
const numberValue = optionsCollapse.numberValue ? "{c}" : "";
|
|
|
|
|
const percentage = optionsCollapse.percentage ? "({d})%" : "";
|
|
|
|
|
const numberValue = optionsSetup.numberValue ? "{c}" : "";
|
|
|
|
|
const percentage = optionsSetup.percentage ? "({d})%" : "";
|
|
|
|
|
const label = {
|
|
|
|
|
show: optionsCollapse.isShow,
|
|
|
|
|
show: optionsSetup.isShow,
|
|
|
|
|
formatter: `{a|{b}:${numberValue} ${percentage}}`,
|
|
|
|
|
rich: {
|
|
|
|
|
a: {
|
|
|
|
|
padding: [-30, 15, -20, 15],
|
|
|
|
|
color: optionsCollapse.subTextColor,
|
|
|
|
|
fontSize: optionsCollapse.fontSize,
|
|
|
|
|
fontWeight: optionsCollapse.fontWeight
|
|
|
|
|
color: optionsSetup.subTextColor,
|
|
|
|
|
fontSize: optionsSetup.fontSize,
|
|
|
|
|
fontWeight: optionsSetup.fontWeight
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fontSize: optionsCollapse.fontSize,
|
|
|
|
|
fontSize: optionsSetup.fontSize,
|
|
|
|
|
|
|
|
|
|
fontWeight: optionsCollapse.optionsCollapse
|
|
|
|
|
fontWeight: optionsSetup.optionsSetup
|
|
|
|
|
};
|
|
|
|
|
for (const key in series) {
|
|
|
|
|
if (series[key].type == "pie") {
|
|
|
|
|
series[key].label = label;
|
|
|
|
|
series[key].labelLine = { show: optionsCollapse.isShow };
|
|
|
|
|
series[key].labelLine = { show: optionsSetup.isShow };
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// tooltip 设置
|
|
|
|
|
setOptionsTooltip() {
|
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
const tooltip = {
|
|
|
|
|
trigger: "item",
|
|
|
|
|
show: true,
|
|
|
|
|
textStyle: {
|
|
|
|
|
color: optionsCollapse.lineColor,
|
|
|
|
|
fontSize: optionsCollapse.fontSize
|
|
|
|
|
color: optionsSetup.tipsColor,
|
|
|
|
|
fontSize: optionsSetup.tipsFontSize
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
this.options.tooltip = tooltip;
|
|
|
|
|
},
|
|
|
|
|
// 边距设置
|
|
|
|
|
setOptionsMargin() {
|
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
const grid = {
|
|
|
|
|
left: optionsCollapse.marginLeft,
|
|
|
|
|
right: optionsCollapse.marginRight,
|
|
|
|
|
bottom: optionsCollapse.marginBottom,
|
|
|
|
|
top: optionsCollapse.marginTop,
|
|
|
|
|
left: optionsSetup.marginLeft,
|
|
|
|
|
right: optionsSetup.marginRight,
|
|
|
|
|
bottom: optionsSetup.marginBottom,
|
|
|
|
|
top: optionsSetup.marginTop,
|
|
|
|
|
containLabel: true
|
|
|
|
|
};
|
|
|
|
|
this.options.grid = grid;
|
|
|
|
|
},
|
|
|
|
|
// 图例操作 legend
|
|
|
|
|
setOptionsLegend() {
|
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
const legend = this.options.legend;
|
|
|
|
|
legend.show = optionsCollapse.isShowLegend;
|
|
|
|
|
legend.left = optionsCollapse.lateralPosition == "left" ? 0 : "auto";
|
|
|
|
|
legend.right = optionsCollapse.lateralPosition == "right" ? 0 : "auto";
|
|
|
|
|
legend.top = optionsCollapse.longitudinalPosition == "top" ? 0 : "auto";
|
|
|
|
|
legend.show = optionsSetup.isShowLegend;
|
|
|
|
|
legend.left = optionsSetup.lateralPosition == "left" ? 0 : "auto";
|
|
|
|
|
legend.right = optionsSetup.lateralPosition == "right" ? 0 : "auto";
|
|
|
|
|
legend.top = optionsSetup.longitudinalPosition == "top" ? 0 : "auto";
|
|
|
|
|
legend.bottom =
|
|
|
|
|
optionsCollapse.longitudinalPosition == "bottom" ? 0 : "auto";
|
|
|
|
|
legend.orient = optionsCollapse.layoutFront;
|
|
|
|
|
optionsSetup.longitudinalPosition == "bottom" ? 0 : "auto";
|
|
|
|
|
legend.orient = optionsSetup.layoutFront;
|
|
|
|
|
legend.textStyle = {
|
|
|
|
|
color: optionsCollapse.legendColor,
|
|
|
|
|
fontSize: optionsCollapse.fontSize
|
|
|
|
|
color: optionsSetup.legendColor,
|
|
|
|
|
fontSize: optionsSetup.fontSize
|
|
|
|
|
};
|
|
|
|
|
legend.itemWidth = optionsCollapse.legendWidth;
|
|
|
|
|
legend.itemWidth = optionsSetup.legendWidth;
|
|
|
|
|
},
|
|
|
|
|
// 图例颜色修改
|
|
|
|
|
setOptionsColor() {
|
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
|
const customColor = optionsCollapse.customColor;
|
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
const customColor = optionsSetup.customColor;
|
|
|
|
|
if (!customColor) return;
|
|
|
|
|
const arrColor = [];
|
|
|
|
|
for (let i = 0; i < customColor.length; i++) {
|
|
|
|
|