Browse Source

修改barChart轴线

fanghuisheng 4 years ago
parent
commit
595d95e48b

BIN
dist.zip


+ 1 - 1
src/views/home/components/lineChart.vue

@@ -49,7 +49,7 @@ export default {
       if (this.ftrendIcoCount[0].listDate.length) {
         timeLine = this.ftrendIcoCount[0].listDate;
       } else {
-        timeLine = [parseInt(timeall[0].split("-")[2])];
+        timeLine = [parseInt(timeall[0].split("-")[1])+"-"+parseInt(timeall[0].split("-")[2])];
         timeLine.map(() => {
           _this.ftrendIcoCount[0].list.push(0);
           _this.ftrendIcoCount[1].list.push(0);

+ 4 - 5
src/views/site/components/Overview/barChart.vue

@@ -9,7 +9,7 @@ export default {
   props: {},
   data() {
     return {
-      chart:[],
+      chart: [],
       itemStyle: [
         {
           normal: {
@@ -95,7 +95,6 @@ export default {
           barWidth: "4",
           itemStyle: this.itemStyle[ind],
           data: val.list,
-          yAxisIndex: ind == 2 ? 1 : 0,
           showAllSymbol: ind == 2 ? true : false,
           symbol: ind == 2 ? "circle" : "",
           symbolSize: ind == 2 ? 6 : 0,
@@ -109,7 +108,7 @@ export default {
               : {},
         });
       });
-      
+
       option = {
         tooltip: {
           trigger: "axis",
@@ -190,7 +189,7 @@ export default {
           },
           {
             type: "value",
-            name: "平均值",
+            // name: "平均值",
             nameTextStyle: {
               color: "#fff",
               fontSize: 10,
@@ -226,7 +225,7 @@ export default {
       window.addEventListener("resize", () => {
         chart.resize();
       });
-      this.chart = chart
+      this.chart = chart;
     },
   },
 };

+ 0 - 158
src/views/site/components/Overview/histTrendChart2.vue

@@ -1,158 +0,0 @@
-<template>
-  <div ref="distion2" style="width: 100%; height: 100%"></div>
-</template>
-<script>
-import * as echarts from "echarts";
-
-export default {
-  props: {
-    msg: Object,
-    select_filterSec: Object,
-  },
-  data() {
-    return {};
-  },
-
-  mounted() {
-    
-    this.$nextTick(() => {
-      this.initChart();
-      console.log("aaaaaaaaaaaaaaa",this.msg, this.select_filterSec);
-    });
-  },
-
-  beforeUnmount() {
-    window.removeEventListener("resize", this.chart);
-  },
-
-  methods: {
-    //次数分布折线图
-    initChart() {
-      var chart = echarts.init(this.$refs.distion2);
-      var option;
-
-      option = {
-        color: ["#FEB70D", "#50F335", "#0DC8FE"],
-        tooltip: {
-          trigger: "axis",
-        },
-        // 图列组件
-        legend: {
-          itemHeight: 10, //改变圆圈大小
-          itemWidth: 26, //改变圆圈大小
-          itemGap: 30,
-          textStyle: {
-            color: "#fff",
-          },
-
-          left: "30%",
-          bottom: "0",
-        },
-        grid: {
-          left: "0%",
-          right: "0%",
-          bottom: "15%",
-          top: "20%",
-          containLabel: true,
-        },
-        xAxis: {
-          type: "category",
-          boundaryGap: true,
-          data: [
-            "0:00",
-            "2:00",
-            "4:00",
-            "6:00",
-            "8:00",
-            "10:00",
-            "12:00",
-            "13:00",
-            "16:00",
-            "18:00",
-            "20:00",
-            "22:00",
-          ],
-          axisTick: {
-            show: false, //去除刻度线
-          },
-          axisLabel: {
-            color: "#fff", // 文本颜色
-          },
-          axisLine: {
-            show: false, // 去除轴线
-          },
-        },
-        yAxis: {
-          name: "A",
-          nameTextStyle: {
-            color: "#fff",
-            fontSize: 10,
-          },
-          max: 1, //设置左侧最大值
-          type: "value",
-          axisTick: {
-            show: false, //去除刻度线
-          },
-          axisLabel: {
-            color: "#fff", // 文本颜色
-          },
-          axisLine: {
-            show: false, // 去除轴线
-          },
-          splitNumber: 5,
-          splitLine: {
-            show: true,
-            lineStyle: {
-              color: "rgba(255,255,255,0.1)",
-            },
-          },
-        },
-        series: [
-          {
-            name: "IA(A)",
-            type: "line",
-            smooth: false, // 曲线是否平滑显示
-            // data: yearData[0].data[0],
-            data: [
-              0.23, 0.12, 0.23, 0.22, 0.42, 0.52, 0.11, 0.24, 0.4, 0.101, 0.134,
-              0.3, 0.23, 0.21,
-            ],
-            symbolSize: 6, //拐点圆的大小
-            // symbol: 'circle',
-          },
-          {
-            name: "IB(A)",
-            type: "line",
-            smooth: false, // 曲线是否平滑显示
-            // data: yearData[0].data[1],
-            data: [
-              0.12, 0.23, 0.22, 0.42, 0.52, 0.23, 0.21, 0.23, 0.11, 0.21, 0.23,
-              0.12, 0.23,
-            ],
-            symbolSize: 6, //拐点圆的大小
-            // symbol: 'circle',
-          },
-          {
-            name: "IC(A)",
-            type: "line",
-            smooth: false, // 曲线是否平滑显示
-            // data: yearData[0].data[1],
-            data: [
-              0.23, 0.12, 0.23, 0.23, 0.21, 0.23, 0.12, 0.23, 0.22, 0.42, 0.52,
-              0.11, 0.21,
-            ],
-            symbolSize: 6, //拐点圆的大小
-            // symbol: 'circle',
-          },
-        ],
-      };
-
-      chart.setOption(option);
-      window.addEventListener("resize", () => {
-        chart.resize();
-      });
-      this.chart = chart;
-    },
-  },
-};
-</script>