|
@@ -52,34 +52,33 @@ export default {
|
|
|
return {
|
|
|
id: "",
|
|
|
chart: null,
|
|
|
- lineStyles: [
|
|
|
- {
|
|
|
+ lineStyles: [],
|
|
|
+ green:{
|
|
|
areaStyle: {
|
|
|
- color: "rgba(75,85,174, 0.9)",
|
|
|
+ color: "rgba(165,228,175, 0.9)",
|
|
|
},
|
|
|
lineStyle: {
|
|
|
color: "rgba(255,255,255, 0.85)",
|
|
|
},
|
|
|
itemStyle: {
|
|
|
- color: "rgba(75,85,174, 0.5)",
|
|
|
+ color: "rgba(165,228,175, 0.5)",
|
|
|
borderColor: "rgba(255,255,255, 0.5)",
|
|
|
borderWidth: 0.5,
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
+ blue:{
|
|
|
areaStyle: {
|
|
|
- color: "rgba(165,228,175, 0.9)",
|
|
|
+ color: 'rgba(75,85,174, 0.9)',
|
|
|
},
|
|
|
lineStyle: {
|
|
|
color: "rgba(255,255,255, 0.85)",
|
|
|
},
|
|
|
itemStyle: {
|
|
|
- color: "rgba(165,228,175, 0.5)",
|
|
|
+ color:'rgba(75,85,174, 0.9)',
|
|
|
borderColor: "rgba(255,255,255, 0.5)",
|
|
|
borderWidth: 0.5,
|
|
|
},
|
|
|
- },
|
|
|
- ],
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -95,10 +94,16 @@ export default {
|
|
|
return result;
|
|
|
},
|
|
|
initChart() {
|
|
|
+ let themeName = this.$store.state.themeName.split(' ')[1];
|
|
|
let chart = echarts.init(this.$el);
|
|
|
-
|
|
|
let maxValue = -1;
|
|
|
-
|
|
|
+
|
|
|
+ if(themeName === "dark"){
|
|
|
+ this.lineStyles = [this.green,this.blue];
|
|
|
+ }else{
|
|
|
+ this.lineStyles = [this.blue,this.green];
|
|
|
+ }
|
|
|
+
|
|
|
if (this.value.length > 0)
|
|
|
this.value[0].data.forEach((item, index) => {
|
|
|
item.value.forEach((value) => {
|
|
@@ -130,20 +135,32 @@ export default {
|
|
|
},
|
|
|
tooltip: {
|
|
|
trigger: "item",
|
|
|
- backgroundColor: "rgba(0,0,0,0.4)",
|
|
|
- borderColor: partten.getColor("gray"),
|
|
|
+ backgroundColor:
|
|
|
+ themeName === "dark"
|
|
|
+ ? "rgba(0,0,0,0.4)"
|
|
|
+ : "rgba(255,255,255,0.5)",
|
|
|
+ borderColor:
|
|
|
+ themeName === "dark"
|
|
|
+ ? partten.getColor("gray")
|
|
|
+ : "#000",
|
|
|
textStyle: {
|
|
|
- color: "#fff",
|
|
|
+ color: themeName === "dark" ? "#fff" : "#000",
|
|
|
fontSize: util.vh(16),
|
|
|
},
|
|
|
},
|
|
|
legend: {
|
|
|
show: this.showLegend,
|
|
|
bottom: 16,
|
|
|
- inactiveColor: partten.getColor("gray"),
|
|
|
+ inactiveColor:
|
|
|
+ themeName === "dark"
|
|
|
+ ? partten.getColor("gray")
|
|
|
+ : "#000",
|
|
|
textStyle: {
|
|
|
- color: partten.getColor("grayl"),
|
|
|
fontSize: 12,
|
|
|
+ color:
|
|
|
+ themeName === "dark"
|
|
|
+ ? partten.getColor("grayl")
|
|
|
+ : "#000",
|
|
|
},
|
|
|
},
|
|
|
radar: [
|
|
@@ -155,19 +172,25 @@ export default {
|
|
|
nameGap: "16",
|
|
|
name: {
|
|
|
textStyle: {
|
|
|
- color: partten.getColor("gray") + 99,
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray") + 99
|
|
|
+ : "#000",
|
|
|
fontSize: 12,
|
|
|
},
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
- color: partten.getColor("gray") + 40,
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray") + 40
|
|
|
+ : "#000" + 40,
|
|
|
},
|
|
|
},
|
|
|
splitLine: {
|
|
|
lineStyle: {
|
|
|
width: 1,
|
|
|
- color: partten.getColor("gray") + 40,
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray") + 40
|
|
|
+ : "#000" + 40,
|
|
|
},
|
|
|
},
|
|
|
splitArea: {
|
|
@@ -188,7 +211,9 @@ export default {
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
- color: partten.getColor("gray") + 40,
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray") + 40
|
|
|
+ : "#000" + 40,
|
|
|
shadowBlur: 1,
|
|
|
shadowColor: "#fff",
|
|
|
shadowOffsetX: 0.5,
|
|
@@ -198,7 +223,9 @@ export default {
|
|
|
splitLine: {
|
|
|
lineStyle: {
|
|
|
width: 1,
|
|
|
- color: partten.getColor("gray") + 40,
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray") + 40
|
|
|
+ : "#000" + 40,
|
|
|
shadowColor: "#fff",
|
|
|
shadowBlur: 0,
|
|
|
shadowOffsetX: 0.5,
|
|
@@ -222,13 +249,17 @@ export default {
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
- color: partten.getColor("gray") + 40,
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray") + 40
|
|
|
+ : "#000" + 40,
|
|
|
},
|
|
|
},
|
|
|
splitLine: {
|
|
|
lineStyle: {
|
|
|
width: 1,
|
|
|
- color: partten.getColor("gray"),
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray")
|
|
|
+ : "#000",
|
|
|
},
|
|
|
},
|
|
|
splitArea: {
|
|
@@ -246,7 +277,9 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
offset: 1,
|
|
|
- color: partten.getColor("green") + 60, // 100% 处的颜色
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("green") + 60
|
|
|
+ : partten.getColor("deepblue") + 60, // 100% 处的颜色
|
|
|
},
|
|
|
],
|
|
|
global: false, // 缺省为 false
|
|
@@ -265,13 +298,17 @@ export default {
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
- color: partten.getColor("gray") + 40,
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray") + 40
|
|
|
+ : "#000" + 40,
|
|
|
},
|
|
|
},
|
|
|
splitLine: {
|
|
|
lineStyle: {
|
|
|
width: 1,
|
|
|
- color: partten.getColor("gray"),
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray")
|
|
|
+ : "#000",
|
|
|
},
|
|
|
},
|
|
|
splitArea: {
|
|
@@ -289,7 +326,9 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
offset: 1,
|
|
|
- color: partten.getColor("green") + 60, // 100% 处的颜色
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("green") + 60
|
|
|
+ : partten.getColor("deepblue") + 60, // 100% 处的颜色
|
|
|
},
|
|
|
],
|
|
|
global: false, // 缺省为 false
|
|
@@ -308,13 +347,17 @@ export default {
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
- color: partten.getColor("gray") + 40,
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray") + 40
|
|
|
+ : "#000" + 40,
|
|
|
},
|
|
|
},
|
|
|
splitLine: {
|
|
|
lineStyle: {
|
|
|
width: 1,
|
|
|
- color: partten.getColor("gray"),
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray")
|
|
|
+ : "#000",
|
|
|
},
|
|
|
},
|
|
|
splitArea: {
|
|
@@ -335,13 +378,17 @@ export default {
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
- color: partten.getColor("gray") + 40,
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray") + 40
|
|
|
+ : "#000" + 40,
|
|
|
},
|
|
|
},
|
|
|
splitLine: {
|
|
|
lineStyle: {
|
|
|
width: 1,
|
|
|
- color: partten.getColor("gray"),
|
|
|
+ color: themeName === "dark"
|
|
|
+ ? partten.getColor("gray")
|
|
|
+ : "#000",
|
|
|
},
|
|
|
},
|
|
|
splitArea: {
|
|
@@ -374,6 +421,11 @@ export default {
|
|
|
this.initChart();
|
|
|
});
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ "$store.state.themeName"() {
|
|
|
+ this.initChart();
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|