-
@@ -81,12 +76,16 @@ export default {
);
console.log("当前要渲染的数据对象", chartsObj);
console.log("当前要渲染的颜色对象", colorObj);
- const titleFontSize = this.$refs.chart_ref.offsetWidth / 50;
+ const titleFontSize = this.$refs.chart_ref.offsetWidth / 100;
let adapterOption = {};
// 添加折线的配置
adapterOption = {
tooltip: {
trigger: "axis",
+ textStyle: {
+ // 设置提示框内文字的大小
+ fontSize: titleFontSize,
+ },
// 自定义 tooltip 内容
formatter: function (params) {
var res = params[0].name + "
";
@@ -139,9 +138,13 @@ export default {
{
data: chartsObj.data,
name: event,
+ // 拐点大小
+ symbolSize: titleFontSize * 0.5,
//折线颜色
itemStyle: {
color: colorObj.color, //折线的颜色
+ // 设置折线的厚度
+ width: titleFontSize * 0.1,
},
lineStyle: {
color: colorObj.color, //折线点的颜色
@@ -166,6 +169,46 @@ export default {
global: false, // 缺省为 false
},
},
+ markPoint: {
+ data: [
+ {
+ type: 'max',
+ name: '最大值',
+ symbol: 'arrow',
+ symbolRotate: 180,
+ label: {
+ formatter: function (params) {
+ return params.value + chartsObj.unit;
+ }
+ }
+ },
+ {
+ type: 'min',
+ name: '最小值',
+ symbol: 'arrow',
+ symbolRotate: 180,
+ label: {
+ formatter: function (params) {
+ return params.value + chartsObj.unit;
+ }
+ }
+ }
+ ],
+ label: {
+ fontSize: titleFontSize * 0.8,
+ color: colorObj.color,
+ fontWeight: 'bold',
+ padding: [4, 8],
+ borderRadius: 4,
+ backgroundColor: 'rgba(0, 0, 0, 0.7)',
+ // symbolSize: titleFontSize * 0.8,
+ offset: [0, -titleFontSize * 1.5]
+ },
+ itemStyle: {
+ color: colorObj.color
+ },
+ symbolSize: titleFontSize * 1
+ }
},
],
};
@@ -291,27 +334,29 @@ export default {
.right-table {
padding: 27px 15px 35px 15px;
}
-.choice {
- margin-left: 0 !important;
-}
+
.mr20 {
width: 92px;
padding: 2px;
}
+
.charts {
margin-top: 20px;
width: 100%;
height: 300px;
}
+
// 媒体查询,适配大于2000px分辨率的大屏样式
@media (min-width: 2000px) {
.right-table {
padding: 0.27rem 0.15rem 0.25rem 0.15rem !important;
}
+
.mr20 {
width: 0.92rem !important;
padding: 0.02rem !important;
}
+
.charts {
margin-top: 0.2rem !important;
height: 3rem !important;
diff --git a/src/views/index.vue b/src/views/index.vue
index c1cdf50..7049c55 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -5,25 +5,32 @@
项目简介