|
|
@ -95,12 +95,7 @@ export default {
|
|
|
|
barWidth: "20px",
|
|
|
|
barWidth: "20px",
|
|
|
|
itemStyle: {
|
|
|
|
itemStyle: {
|
|
|
|
normal: {
|
|
|
|
normal: {
|
|
|
|
color: new echarts.graphic.LinearGradient(
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
|
|
|
|
1,
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
offset: 0,
|
|
|
|
offset: 0,
|
|
|
|
color: "rgba(0,244,255,1)" // 0% 处的颜色
|
|
|
|
color: "rgba(0,244,255,1)" // 0% 处的颜色
|
|
|
@ -112,38 +107,22 @@ export default {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
false
|
|
|
|
false
|
|
|
|
),
|
|
|
|
),
|
|
|
|
barBorderRadius: [30, 30, 30, 30],
|
|
|
|
|
|
|
|
shadowColor: "rgba(0,160,221,1)",
|
|
|
|
shadowColor: "rgba(0,160,221,1)",
|
|
|
|
|
|
|
|
//模糊细数
|
|
|
|
shadowBlur: 4
|
|
|
|
shadowBlur: 4
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
label: {
|
|
|
|
label: {
|
|
|
|
normal: {
|
|
|
|
normal: {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
lineHeight: 30,
|
|
|
|
position: ['-10', '-30'],
|
|
|
|
width: 80,
|
|
|
|
|
|
|
|
height: 30,
|
|
|
|
|
|
|
|
backgroundColor: "rgba(0,160,221,0.1)",
|
|
|
|
|
|
|
|
borderRadius: 200,
|
|
|
|
|
|
|
|
position: ["-8", "-60"],
|
|
|
|
|
|
|
|
distance: 1,
|
|
|
|
distance: 1,
|
|
|
|
formatter: [" {d|●}", " {a|{c}} \n", " {b|}"].join(
|
|
|
|
formatter: '{a|{c}}',
|
|
|
|
","
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
rich: {
|
|
|
|
rich: {
|
|
|
|
d: {
|
|
|
|
|
|
|
|
color: "#3CDDCF"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
a: {
|
|
|
|
a: {
|
|
|
|
|
|
|
|
fontSize: 15,
|
|
|
|
color: "#fff",
|
|
|
|
color: "#fff",
|
|
|
|
align: "center"
|
|
|
|
align: "center"
|
|
|
|
},
|
|
|
|
|
|
|
|
b: {
|
|
|
|
|
|
|
|
width: 1,
|
|
|
|
|
|
|
|
height: 30,
|
|
|
|
|
|
|
|
borderWidth: 1,
|
|
|
|
|
|
|
|
borderColor: "#234e6c",
|
|
|
|
|
|
|
|
align: "left"
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -171,7 +150,6 @@ export default {
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
value: {
|
|
|
|
value: {
|
|
|
|
handler(val) {
|
|
|
|
handler(val) {
|
|
|
|
console.log(val);
|
|
|
|
|
|
|
|
this.optionsStyle = val.position;
|
|
|
|
this.optionsStyle = val.position;
|
|
|
|
this.optionsData = val.data;
|
|
|
|
this.optionsData = val.data;
|
|
|
|
this.optionsCollapse = val.setup;
|
|
|
|
this.optionsCollapse = val.setup;
|
|
|
@ -194,10 +172,8 @@ export default {
|
|
|
|
this.setOptionsTitle();
|
|
|
|
this.setOptionsTitle();
|
|
|
|
this.setOptionsX();
|
|
|
|
this.setOptionsX();
|
|
|
|
this.setOptionsY();
|
|
|
|
this.setOptionsY();
|
|
|
|
// this.setOptionsTop()
|
|
|
|
this.setOptionsTop();
|
|
|
|
// this.setOptionsTooltip()
|
|
|
|
|
|
|
|
this.setOptionsMargin();
|
|
|
|
this.setOptionsMargin();
|
|
|
|
// this.setOptionsLegend()
|
|
|
|
|
|
|
|
this.setOptionsColor();
|
|
|
|
this.setOptionsColor();
|
|
|
|
this.setOptionsData();
|
|
|
|
this.setOptionsData();
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -229,15 +205,11 @@ export default {
|
|
|
|
type: "category",
|
|
|
|
type: "category",
|
|
|
|
show: optionsCollapse.hideX, // 坐标轴是否显示
|
|
|
|
show: optionsCollapse.hideX, // 坐标轴是否显示
|
|
|
|
name: optionsCollapse.xName, // 坐标轴名称
|
|
|
|
name: optionsCollapse.xName, // 坐标轴名称
|
|
|
|
nameTextStyle: {
|
|
|
|
|
|
|
|
color: optionsCollapse.xNameColor,
|
|
|
|
|
|
|
|
fontSize: optionsCollapse.xNameFontSize
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
nameRotate: optionsCollapse.textAngle, // 文字角度
|
|
|
|
nameRotate: optionsCollapse.textAngle, // 文字角度
|
|
|
|
inverse: optionsCollapse.reversalX, // 轴反转
|
|
|
|
inverse: optionsCollapse.reversalX, // 轴反转
|
|
|
|
axisLabel: {
|
|
|
|
axisLabel: {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
interval: optionsCollapse.textInterval, // 文字角度
|
|
|
|
interval: optionsCollapse.textInterval, // 文字间隔
|
|
|
|
rotate: optionsCollapse.textAngle, // 文字角度
|
|
|
|
rotate: optionsCollapse.textAngle, // 文字角度
|
|
|
|
textStyle: {
|
|
|
|
textStyle: {
|
|
|
|
color: optionsCollapse.Xcolor, // x轴 坐标文字颜色
|
|
|
|
color: optionsCollapse.Xcolor, // x轴 坐标文字颜色
|
|
|
@ -266,15 +238,13 @@ export default {
|
|
|
|
type: "value",
|
|
|
|
type: "value",
|
|
|
|
show: optionsCollapse.isShowY, // 坐标轴是否显示
|
|
|
|
show: optionsCollapse.isShowY, // 坐标轴是否显示
|
|
|
|
name: optionsCollapse.textNameY, // 坐标轴名称
|
|
|
|
name: optionsCollapse.textNameY, // 坐标轴名称
|
|
|
|
nameTextStyle: {
|
|
|
|
|
|
|
|
color: optionsCollapse.NameColorY,
|
|
|
|
|
|
|
|
fontSize: optionsCollapse.NameFontSizeY
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
inverse: optionsCollapse.reversalY, // 轴反转
|
|
|
|
inverse: optionsCollapse.reversalY, // 轴反转
|
|
|
|
axisLabel: {
|
|
|
|
axisLabel: {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
|
|
|
|
interval: optionsCollapse.ytextInterval, // 文字间隔
|
|
|
|
|
|
|
|
rotate: optionsCollapse.ytextAngle, // 文字角度
|
|
|
|
textStyle: {
|
|
|
|
textStyle: {
|
|
|
|
color: optionsCollapse.colorY, // x轴 坐标文字颜色
|
|
|
|
color: optionsCollapse.colorY, // y轴 坐标文字颜色
|
|
|
|
fontSize: optionsCollapse.fontSizeY
|
|
|
|
fontSize: optionsCollapse.fontSizeY
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -291,14 +261,12 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
this.options.yAxis = yAxis;
|
|
|
|
this.options.yAxis = yAxis;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 数值设定 or 柱体设置
|
|
|
|
// 数值设定 or 柱体设置
|
|
|
|
setOptionsTop() {
|
|
|
|
setOptionsTop() {
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
const series = this.options.series;
|
|
|
|
const series = this.options.series;
|
|
|
|
|
|
|
|
|
|
|
|
for (const key in series) {
|
|
|
|
for (const key in series) {
|
|
|
|
if (series[key].type == "bar") {
|
|
|
|
if (series[key].type == "bar") {
|
|
|
|
series[key].label = {
|
|
|
|
series[key].label = {
|
|
|
@ -310,7 +278,7 @@ export default {
|
|
|
|
fontWeight: optionsCollapse.fontWeight
|
|
|
|
fontWeight: optionsCollapse.fontWeight
|
|
|
|
};
|
|
|
|
};
|
|
|
|
series[key].barWidth = optionsCollapse.maxWidth;
|
|
|
|
series[key].barWidth = optionsCollapse.maxWidth;
|
|
|
|
series[key].barMinHeight = optionsCollapse.minHeight;
|
|
|
|
//series[key].barMinHeight = optionsCollapse.minHeight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.options.series = series;
|
|
|
|
this.options.series = series;
|
|
|
@ -360,13 +328,25 @@ export default {
|
|
|
|
// 渐变色
|
|
|
|
// 渐变色
|
|
|
|
setOptionsColor(){
|
|
|
|
setOptionsColor(){
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
const barStart = {};
|
|
|
|
const itemStyle = this.options.series[0]['itemStyle']
|
|
|
|
barStart["offset"] = 0;
|
|
|
|
const normal = {
|
|
|
|
barStart["color"] = optionsCollapse.barStart;
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
const barEnd = {};
|
|
|
|
{
|
|
|
|
barStart["offset"] = 1;
|
|
|
|
offset: 0,
|
|
|
|
barStart["color"] = optionsCollapse.barEnd;
|
|
|
|
color: optionsCollapse.bar0color // 0% 处的颜色
|
|
|
|
// this.options.series[0].itemStyle.normal.color = new echarts.graphic.LinearGradient(0, 0, 0, 1,[ barStart, barEnd], false)
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: optionsCollapse.bar100color // 100% 处的颜色
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
false
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
barBorderRadius: optionsCollapse.radius, //圆角
|
|
|
|
|
|
|
|
shadowColor: optionsCollapse.shadowColor, // 阴影颜色
|
|
|
|
|
|
|
|
shadowBlur: optionsCollapse.shadowBlur //模糊系数
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
itemStyle['normal'] = normal
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 数据解析
|
|
|
|
// 数据解析
|
|
|
|
setOptionsData() {
|
|
|
|
setOptionsData() {
|
|
|
|