|
|
@ -144,6 +144,17 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 轴反转
|
|
|
|
// 轴反转
|
|
|
|
inverse: optionsSetup.reversalX,
|
|
|
|
inverse: optionsSetup.reversalX,
|
|
|
|
|
|
|
|
axisLabel: {
|
|
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
|
|
interval: optionsSetup.textInterval,
|
|
|
|
|
|
|
|
// 文字角度
|
|
|
|
|
|
|
|
rotate: optionsSetup.textAngleX,
|
|
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
|
|
// 坐标文字颜色
|
|
|
|
|
|
|
|
color: optionsSetup.colorX,
|
|
|
|
|
|
|
|
fontSize: optionsSetup.fontSizeX,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
axisLine: {
|
|
|
|
axisLine: {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
lineStyle: {
|
|
|
|
lineStyle: {
|
|
|
@ -382,17 +393,6 @@ export default {
|
|
|
|
legendName.push(yAxisList[i]);
|
|
|
|
legendName.push(yAxisList[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.options.series = series;
|
|
|
|
this.options.series = series;
|
|
|
|
if (optionsSetup.verticalShow) {
|
|
|
|
|
|
|
|
this.options.xAxis.data = [];
|
|
|
|
|
|
|
|
this.options.yAxis.data = xAxisList;
|
|
|
|
|
|
|
|
this.options.xAxis.type = "value";
|
|
|
|
|
|
|
|
this.options.yAxis.type = "category";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.options.xAxis.data = xAxisList;
|
|
|
|
|
|
|
|
this.options.yAxis.data = [];
|
|
|
|
|
|
|
|
this.options.xAxis.type = "category";
|
|
|
|
|
|
|
|
this.options.yAxis.type = "value";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 根据图表的宽度 x轴的字体大小、长度来估算X轴的label能展示多少个字
|
|
|
|
// 根据图表的宽度 x轴的字体大小、长度来估算X轴的label能展示多少个字
|
|
|
|
const rowsNum = optionsSetup.textRowsNum !== "" ? optionsSetup.textRowsNum : parseInt((this.optionsStyle.width / xAxisList.length) / optionsSetup.fontSizeX);
|
|
|
|
const rowsNum = optionsSetup.textRowsNum !== "" ? optionsSetup.textRowsNum : parseInt((this.optionsStyle.width / xAxisList.length) / optionsSetup.fontSizeX);
|
|
|
|
const axisLabel = {
|
|
|
|
const axisLabel = {
|
|
|
@ -416,7 +416,20 @@ export default {
|
|
|
|
return str
|
|
|
|
return str
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.options.xAxis.axisLabel = axisLabel;
|
|
|
|
if (optionsSetup.verticalShow) {
|
|
|
|
|
|
|
|
this.options.xAxis.data = [];
|
|
|
|
|
|
|
|
this.options.yAxis.data = xAxisList;
|
|
|
|
|
|
|
|
this.options.xAxis.type = "value";
|
|
|
|
|
|
|
|
this.options.yAxis.type = "category";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.options.xAxis.data = xAxisList;
|
|
|
|
|
|
|
|
this.options.yAxis.data = [];
|
|
|
|
|
|
|
|
this.options.xAxis.type = "category";
|
|
|
|
|
|
|
|
this.options.yAxis.type = "value";
|
|
|
|
|
|
|
|
if (optionsSetup.textRowsBreakAuto) {
|
|
|
|
|
|
|
|
this.options.xAxis.axisLabel = axisLabel;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
this.options.legend["data"] = legendName;
|
|
|
|
this.options.legend["data"] = legendName;
|
|
|
|
this.setOptionsLegendName(legendName);
|
|
|
|
this.setOptionsLegendName(legendName);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -445,18 +458,6 @@ export default {
|
|
|
|
for (let i = 0; i < customColor.length; i++) {
|
|
|
|
for (let i = 0; i < customColor.length; i++) {
|
|
|
|
arrColor.push(customColor[i].color);
|
|
|
|
arrColor.push(customColor[i].color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// x轴
|
|
|
|
|
|
|
|
if (optionsSetup.verticalShow) {
|
|
|
|
|
|
|
|
this.options.xAxis.data = [];
|
|
|
|
|
|
|
|
this.options.yAxis.data = val.xAxis;
|
|
|
|
|
|
|
|
this.options.xAxis.type = "value";
|
|
|
|
|
|
|
|
this.options.yAxis.type = "category";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.options.xAxis.data = val.xAxis;
|
|
|
|
|
|
|
|
this.options.yAxis.data = [];
|
|
|
|
|
|
|
|
this.options.xAxis.type = "category";
|
|
|
|
|
|
|
|
this.options.yAxis.type = "value";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const series = [];
|
|
|
|
const series = [];
|
|
|
|
const legendName = [];
|
|
|
|
const legendName = [];
|
|
|
|
for (const i in val.series) {
|
|
|
|
for (const i in val.series) {
|
|
|
@ -523,7 +524,21 @@ export default {
|
|
|
|
return str
|
|
|
|
return str
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.options.xAxis.axisLabel = axisLabel;
|
|
|
|
// x轴
|
|
|
|
|
|
|
|
if (optionsSetup.verticalShow) {
|
|
|
|
|
|
|
|
this.options.xAxis.data = [];
|
|
|
|
|
|
|
|
this.options.yAxis.data = val.xAxis;
|
|
|
|
|
|
|
|
this.options.xAxis.type = "value";
|
|
|
|
|
|
|
|
this.options.yAxis.type = "category";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.options.xAxis.data = val.xAxis;
|
|
|
|
|
|
|
|
this.options.yAxis.data = [];
|
|
|
|
|
|
|
|
this.options.xAxis.type = "category";
|
|
|
|
|
|
|
|
this.options.yAxis.type = "value";
|
|
|
|
|
|
|
|
if (optionsSetup.textRowsBreakAuto) {
|
|
|
|
|
|
|
|
this.options.xAxis.axisLabel = axisLabel;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
this.options.series = series;
|
|
|
|
this.options.series = series;
|
|
|
|
this.options.legend["data"] = legendName;
|
|
|
|
this.options.legend["data"] = legendName;
|
|
|
|
this.setOptionsLegendName(legendName);
|
|
|
|
this.setOptionsLegendName(legendName);
|
|
|
|