|
|
@ -31,17 +31,7 @@ export default {
|
|
|
|
top: '16%',
|
|
|
|
top: '16%',
|
|
|
|
containLabel: true
|
|
|
|
containLabel: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
legend: {
|
|
|
|
legend: {},
|
|
|
|
data: ['调解成功', '调解失败', '调解终止', '调解成功率'],
|
|
|
|
|
|
|
|
left: '7%',
|
|
|
|
|
|
|
|
top: '5%',
|
|
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
|
|
color: '#666666'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
itemWidth: 15,
|
|
|
|
|
|
|
|
itemHeight: 10,
|
|
|
|
|
|
|
|
itemGap: 25
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
xAxis: {
|
|
|
|
xAxis: {
|
|
|
|
type: 'category',
|
|
|
|
type: 'category',
|
|
|
|
data: ['2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019'],
|
|
|
|
data: ['2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019'],
|
|
|
@ -132,23 +122,6 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: []
|
|
|
|
data: []
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
name: '调解终止',
|
|
|
|
|
|
|
|
type: 'bar',
|
|
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
|
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
|
|
color: '#01c871'
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: '#55f49c'
|
|
|
|
|
|
|
|
}]),
|
|
|
|
|
|
|
|
barBorderRadius: 6,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
data: []
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: '调解成功率',
|
|
|
|
name: '调解成功率',
|
|
|
|
type: 'line',
|
|
|
|
type: 'line',
|
|
|
@ -156,14 +129,13 @@ export default {
|
|
|
|
smooth: false, //平滑曲线显示
|
|
|
|
smooth: false, //平滑曲线显示
|
|
|
|
symbol: 'circle', //标记的图形为实心圆
|
|
|
|
symbol: 'circle', //标记的图形为实心圆
|
|
|
|
symbolSize: 8, //标记的大小
|
|
|
|
symbolSize: 8, //标记的大小
|
|
|
|
itemStyle: {
|
|
|
|
/*itemStyle: {
|
|
|
|
normal: {
|
|
|
|
normal: {
|
|
|
|
color: '#ffa43a',
|
|
|
|
color: '#ffa43a',
|
|
|
|
borderColor: 'rgba(255, 234, 0, 0.5)', //圆点透明 边框
|
|
|
|
borderColor: 'rgba(255, 234, 0, 0.5)', //圆点透明 边框
|
|
|
|
borderWidth: 5
|
|
|
|
borderWidth: 5
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
},*/
|
|
|
|
},
|
|
|
|
|
|
|
|
lineStyle: {
|
|
|
|
lineStyle: {
|
|
|
|
color: '#ffa43a'
|
|
|
|
color: '#ffa43a'
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -213,7 +185,6 @@ export default {
|
|
|
|
this.setOptionsLegend();
|
|
|
|
this.setOptionsLegend();
|
|
|
|
this.setOptionsTooltip();
|
|
|
|
this.setOptionsTooltip();
|
|
|
|
this.setOptionsMargin();
|
|
|
|
this.setOptionsMargin();
|
|
|
|
this.setOptionsColor();
|
|
|
|
|
|
|
|
this.setOptionsData();
|
|
|
|
this.setOptionsData();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 标题修改
|
|
|
|
// 标题修改
|
|
|
@ -412,7 +383,7 @@ export default {
|
|
|
|
legend.itemWidth = optionsSetup.legendWidth;
|
|
|
|
legend.itemWidth = optionsSetup.legendWidth;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 图例名称设置
|
|
|
|
// 图例名称设置
|
|
|
|
setOptionsLegendName(name){
|
|
|
|
setOptionsLegendName(name) {
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const series = this.options.series;
|
|
|
|
const series = this.options.series;
|
|
|
|
const legendName = optionsSetup.legendName;
|
|
|
|
const legendName = optionsSetup.legendName;
|
|
|
@ -422,7 +393,7 @@ export default {
|
|
|
|
series[i].name = name[i];
|
|
|
|
series[i].name = name[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.options.legend['data'] = name;
|
|
|
|
this.options.legend['data'] = name;
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
const arr = legendName.split('|');
|
|
|
|
const arr = legendName.split('|');
|
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
|
|
series[i].name = arr[i];
|
|
|
|
series[i].name = arr[i];
|
|
|
@ -430,24 +401,6 @@ export default {
|
|
|
|
this.options.legend['data'] = arr
|
|
|
|
this.options.legend['data'] = arr
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 颜色修改
|
|
|
|
|
|
|
|
setOptionsColor() {
|
|
|
|
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
|
|
|
const customColor = optionsSetup.customColor;
|
|
|
|
|
|
|
|
const series = this.options.series;
|
|
|
|
|
|
|
|
if (!customColor) return;
|
|
|
|
|
|
|
|
const arrColor = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < customColor.length; i++) {
|
|
|
|
|
|
|
|
arrColor.push(customColor[i].color);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const i in series) {
|
|
|
|
|
|
|
|
if (series[i].type == 'bar') {
|
|
|
|
|
|
|
|
series[i].itemStyle.normal['color'] = arrColor[i];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
series[i].lineStyle['color'] = arrColor[i];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 数据处理
|
|
|
|
// 数据处理
|
|
|
|
setOptionsData() {
|
|
|
|
setOptionsData() {
|
|
|
|
const optionsData = this.optionsData; // 数据类型 静态 or 动态
|
|
|
|
const optionsData = this.optionsData; // 数据类型 静态 or 动态
|
|
|
@ -457,6 +410,12 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
staticDataFn(val) {
|
|
|
|
staticDataFn(val) {
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
|
|
|
//颜色
|
|
|
|
|
|
|
|
const customColor = optionsSetup.customColor;
|
|
|
|
|
|
|
|
const arrColor = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < customColor.length; i++) {
|
|
|
|
|
|
|
|
arrColor.push(customColor[i].color);
|
|
|
|
|
|
|
|
}
|
|
|
|
const series = this.options.series;
|
|
|
|
const series = this.options.series;
|
|
|
|
let axis = [];
|
|
|
|
let axis = [];
|
|
|
|
let bar1 = [];
|
|
|
|
let bar1 = [];
|
|
|
@ -468,11 +427,17 @@ export default {
|
|
|
|
bar2[i] = val[i].manus;
|
|
|
|
bar2[i] = val[i].manus;
|
|
|
|
line[i] = val[i].sales;
|
|
|
|
line[i] = val[i].sales;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const legendName = [];
|
|
|
|
|
|
|
|
legendName.push('调解成功');
|
|
|
|
|
|
|
|
legendName.push('调解失败');
|
|
|
|
|
|
|
|
legendName.push('调解成功率');
|
|
|
|
// x轴
|
|
|
|
// x轴
|
|
|
|
this.options.xAxis.data = axis;
|
|
|
|
this.options.xAxis.data = axis;
|
|
|
|
// series
|
|
|
|
// series
|
|
|
|
for (const i in series) {
|
|
|
|
for (const i in series) {
|
|
|
|
if (series[i].type == 'bar') {
|
|
|
|
if (series[i].type == 'bar') {
|
|
|
|
|
|
|
|
series[i].name = legendName[i];
|
|
|
|
|
|
|
|
series[i].type = 'bar';
|
|
|
|
series[i].label = {
|
|
|
|
series[i].label = {
|
|
|
|
show: optionsSetup.isShowBar,
|
|
|
|
show: optionsSetup.isShowBar,
|
|
|
|
position: 'top',
|
|
|
|
position: 'top',
|
|
|
@ -483,8 +448,12 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
series[i].barWidth = optionsSetup.maxWidth;
|
|
|
|
series[i].barWidth = optionsSetup.maxWidth;
|
|
|
|
series[i].itemStyle.normal['barBorderRadius'] = optionsSetup.radius;
|
|
|
|
series[i].itemStyle.normal['barBorderRadius'] = optionsSetup.radius;
|
|
|
|
|
|
|
|
series[i].itemStyle.normal['color'] = arrColor[i];
|
|
|
|
} else if (series[i].type == 'line') {
|
|
|
|
} else if (series[i].type == 'line') {
|
|
|
|
|
|
|
|
series[i].name = legendName[i];
|
|
|
|
|
|
|
|
series[i].type = 'line';
|
|
|
|
series[i].yAxisIndex = 1;
|
|
|
|
series[i].yAxisIndex = 1;
|
|
|
|
|
|
|
|
series[i].symbol = optionsSetup.symbol;
|
|
|
|
series[i].showSymbol = optionsSetup.markPoint;
|
|
|
|
series[i].showSymbol = optionsSetup.markPoint;
|
|
|
|
series[i].symbolSize = optionsSetup.pointSize;
|
|
|
|
series[i].symbolSize = optionsSetup.pointSize;
|
|
|
|
series[i].smooth = optionsSetup.smoothCurve;
|
|
|
|
series[i].smooth = optionsSetup.smoothCurve;
|
|
|
@ -497,7 +466,13 @@ export default {
|
|
|
|
opacity: 0
|
|
|
|
opacity: 0
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
series[i].itemStyle = {
|
|
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
|
|
color: arrColor[i],
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
series[i].lineStyle = {
|
|
|
|
series[i].lineStyle = {
|
|
|
|
|
|
|
|
color: arrColor[i],
|
|
|
|
width: optionsSetup.lineWidth
|
|
|
|
width: optionsSetup.lineWidth
|
|
|
|
};
|
|
|
|
};
|
|
|
|
series[i].label = {
|
|
|
|
series[i].label = {
|
|
|
@ -512,11 +487,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
series[0].data = bar1;
|
|
|
|
series[0].data = bar1;
|
|
|
|
series[1].data = bar2;
|
|
|
|
series[1].data = bar2;
|
|
|
|
series[3].data = line;
|
|
|
|
series[2].data = line;
|
|
|
|
const legendName = [];
|
|
|
|
|
|
|
|
legendName.push('调解成功');
|
|
|
|
|
|
|
|
legendName.push('调解失败');
|
|
|
|
|
|
|
|
legendName.push('调解成功率');
|
|
|
|
|
|
|
|
this.options.legend['data'] = legendName;
|
|
|
|
this.options.legend['data'] = legendName;
|
|
|
|
this.setOptionsLegendName(legendName);
|
|
|
|
this.setOptionsLegendName(legendName);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -539,10 +510,17 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
renderingFn(val) {
|
|
|
|
renderingFn(val) {
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
|
|
|
//颜色
|
|
|
|
|
|
|
|
const customColor = optionsSetup.customColor;
|
|
|
|
|
|
|
|
const arrColor = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < customColor.length; i++) {
|
|
|
|
|
|
|
|
arrColor.push(customColor[i].color);
|
|
|
|
|
|
|
|
}
|
|
|
|
this.options.xAxis.data = val.xAxis;
|
|
|
|
this.options.xAxis.data = val.xAxis;
|
|
|
|
const series = [];
|
|
|
|
const series = [];
|
|
|
|
const legendName = [];
|
|
|
|
const legendName = [];
|
|
|
|
for (const i in val.series) {
|
|
|
|
for (const i in val.series) {
|
|
|
|
|
|
|
|
legendName.push(val.series[i].name);
|
|
|
|
const obj = {};
|
|
|
|
const obj = {};
|
|
|
|
if (val.series[i].type == 'bar') {
|
|
|
|
if (val.series[i].type == 'bar') {
|
|
|
|
obj.name = val.series[i].name;
|
|
|
|
obj.name = val.series[i].name;
|
|
|
@ -558,6 +536,7 @@ export default {
|
|
|
|
obj.barWidth = optionsSetup.maxWidth;
|
|
|
|
obj.barWidth = optionsSetup.maxWidth;
|
|
|
|
obj.itemStyle = {
|
|
|
|
obj.itemStyle = {
|
|
|
|
normal: {
|
|
|
|
normal: {
|
|
|
|
|
|
|
|
color: arrColor[i],
|
|
|
|
barBorderRadius: optionsSetup.radius,
|
|
|
|
barBorderRadius: optionsSetup.radius,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -567,6 +546,7 @@ export default {
|
|
|
|
obj.name = val.series[i].name;
|
|
|
|
obj.name = val.series[i].name;
|
|
|
|
obj.type = val.series[i].type;
|
|
|
|
obj.type = val.series[i].type;
|
|
|
|
obj.yAxisIndex = 1;
|
|
|
|
obj.yAxisIndex = 1;
|
|
|
|
|
|
|
|
obj.symbol = optionsSetup.symbol;
|
|
|
|
obj.showSymbol = optionsSetup.markPoint;
|
|
|
|
obj.showSymbol = optionsSetup.markPoint;
|
|
|
|
obj.symbolSize = optionsSetup.pointSize;
|
|
|
|
obj.symbolSize = optionsSetup.pointSize;
|
|
|
|
obj.smooth = optionsSetup.smoothCurve;
|
|
|
|
obj.smooth = optionsSetup.smoothCurve;
|
|
|
@ -577,9 +557,15 @@ export default {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
obj.areaStyle = {
|
|
|
|
obj.areaStyle = {
|
|
|
|
opacity: 0
|
|
|
|
opacity: 0
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
obj.itemStyle = {
|
|
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
|
|
color: arrColor[i],
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
obj.lineStyle = {
|
|
|
|
obj.lineStyle = {
|
|
|
|
|
|
|
|
color: arrColor[i],
|
|
|
|
width: optionsSetup.lineWidth
|
|
|
|
width: optionsSetup.lineWidth
|
|
|
|
};
|
|
|
|
};
|
|
|
|
obj.label = {
|
|
|
|
obj.label = {
|
|
|
@ -593,7 +579,6 @@ export default {
|
|
|
|
obj.data = val.series[i].data;
|
|
|
|
obj.data = val.series[i].data;
|
|
|
|
series.push(obj);
|
|
|
|
series.push(obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
legendName.push(val.series[i].name);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.options.series = series;
|
|
|
|
this.options.series = series;
|
|
|
|
this.options.legend['data'] = legendName;
|
|
|
|
this.options.legend['data'] = legendName;
|
|
|
|