|
|
@ -126,20 +126,25 @@ export default {
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const xAxis = {
|
|
|
|
const xAxis = {
|
|
|
|
type: "category",
|
|
|
|
type: "category",
|
|
|
|
show: optionsSetup.hideX, // 坐标轴是否显示
|
|
|
|
// 坐标轴是否显示
|
|
|
|
name: optionsSetup.xName, // 坐标轴名称
|
|
|
|
show: optionsSetup.hideX,
|
|
|
|
|
|
|
|
// 坐标轴名称
|
|
|
|
|
|
|
|
name: optionsSetup.xName,
|
|
|
|
nameTextStyle: {
|
|
|
|
nameTextStyle: {
|
|
|
|
color: optionsSetup.xNameColor,
|
|
|
|
color: optionsSetup.xNameColor,
|
|
|
|
fontSize: optionsSetup.xNameFontSize
|
|
|
|
fontSize: optionsSetup.xNameFontSize
|
|
|
|
},
|
|
|
|
},
|
|
|
|
nameRotate: optionsSetup.textAngleX, // 文字角度
|
|
|
|
// 轴反转
|
|
|
|
inverse: optionsSetup.reversalX, // 轴反转
|
|
|
|
inverse: optionsSetup.reversalX,
|
|
|
|
axisLabel: {
|
|
|
|
axisLabel: {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
interval: optionsSetup.textInterval, // 文字角度
|
|
|
|
// 文字间隔
|
|
|
|
rotate: optionsSetup.textAngle, // 文字角度
|
|
|
|
interval: optionsSetup.textInterval,
|
|
|
|
|
|
|
|
// 文字角度
|
|
|
|
|
|
|
|
rotate: optionsSetup.textAngleX,
|
|
|
|
textStyle: {
|
|
|
|
textStyle: {
|
|
|
|
color: optionsSetup.Xcolor, // x轴 坐标文字颜色
|
|
|
|
// 坐标文字颜色
|
|
|
|
|
|
|
|
color: optionsSetup.Xcolor,
|
|
|
|
fontSize: optionsSetup.fontSizeX
|
|
|
|
fontSize: optionsSetup.fontSizeX
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -163,18 +168,23 @@ export default {
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const yAxis = {
|
|
|
|
const yAxis = {
|
|
|
|
type: "value",
|
|
|
|
type: "value",
|
|
|
|
show: optionsSetup.isShowY, // 坐标轴是否显示
|
|
|
|
// 坐标轴是否显示
|
|
|
|
name: optionsSetup.textNameY, // 坐标轴名称
|
|
|
|
show: optionsSetup.isShowY,
|
|
|
|
|
|
|
|
// 坐标轴名称
|
|
|
|
|
|
|
|
name: optionsSetup.textNameY,
|
|
|
|
nameTextStyle: {
|
|
|
|
nameTextStyle: {
|
|
|
|
color: optionsSetup.NameColorY,
|
|
|
|
color: optionsSetup.NameColorY,
|
|
|
|
fontSize: optionsSetup.NameFontSizeY
|
|
|
|
fontSize: optionsSetup.NameFontSizeY
|
|
|
|
},
|
|
|
|
},
|
|
|
|
inverse: optionsSetup.reversalY, // y轴反转
|
|
|
|
// y轴反转
|
|
|
|
|
|
|
|
inverse: optionsSetup.reversalY,
|
|
|
|
axisLabel: {
|
|
|
|
axisLabel: {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
rotate: optionsSetup.textAngleY,// 文字角度
|
|
|
|
// 文字角度
|
|
|
|
|
|
|
|
rotate: optionsSetup.textAngleY,
|
|
|
|
textStyle: {
|
|
|
|
textStyle: {
|
|
|
|
color: optionsSetup.colorY, // y轴 坐标文字颜色
|
|
|
|
// y轴 坐标文字颜色
|
|
|
|
|
|
|
|
color: optionsSetup.colorY,
|
|
|
|
fontSize: optionsSetup.fontSizeY
|
|
|
|
fontSize: optionsSetup.fontSizeY
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -264,13 +274,14 @@ export default {
|
|
|
|
// 数据解析
|
|
|
|
// 数据解析
|
|
|
|
setOptionsData() {
|
|
|
|
setOptionsData() {
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsData = this.optionsData; // 数据类型 静态 or 动态
|
|
|
|
// 数据类型 静态 or 动态
|
|
|
|
|
|
|
|
const optionsData = this.optionsData;
|
|
|
|
optionsData.dataType == "staticData"
|
|
|
|
optionsData.dataType == "staticData"
|
|
|
|
? this.staticDataFn(optionsData.staticData, optionsSetup)
|
|
|
|
? this.staticDataFn(optionsData.staticData, optionsSetup)
|
|
|
|
: this.dynamicDataFn(
|
|
|
|
: this.dynamicDataFn(
|
|
|
|
optionsData.dynamicData,
|
|
|
|
optionsData.dynamicData,
|
|
|
|
optionsData.refreshTime,
|
|
|
|
optionsData.refreshTime,
|
|
|
|
optionsSetup
|
|
|
|
optionsSetup
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//去重
|
|
|
|
//去重
|
|
|
@ -298,14 +309,14 @@ export default {
|
|
|
|
xAxisList[i] = val[i].axis
|
|
|
|
xAxisList[i] = val[i].axis
|
|
|
|
yAxisList[i] = val[i].name
|
|
|
|
yAxisList[i] = val[i].name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xAxisList = this.setUnique(xAxisList) // x轴 0725 0726 0727
|
|
|
|
xAxisList = this.setUnique(xAxisList)
|
|
|
|
yAxisList = this.setUnique(yAxisList) // y轴 A B C
|
|
|
|
yAxisList = this.setUnique(yAxisList)
|
|
|
|
for (const i in yAxisList) {
|
|
|
|
for (const i in yAxisList) {
|
|
|
|
const data = new Array(yAxisList.length).fill(0)
|
|
|
|
const data = new Array(yAxisList.length).fill(0)
|
|
|
|
for (const j in xAxisList) {
|
|
|
|
for (const j in xAxisList) {
|
|
|
|
for (const k in val) {
|
|
|
|
for (const k in val) {
|
|
|
|
if (val[k].name == yAxisList[i]) { // a = a
|
|
|
|
if (val[k].name == yAxisList[i]) {
|
|
|
|
if (val[k].axis == xAxisList[j]) { // 0725
|
|
|
|
if (val[k].axis == xAxisList[j]) {
|
|
|
|
data[j] = val[k].data
|
|
|
|
data[j] = val[k].data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|