فهرست منبع

柱状图+头部信息展示

PrinceLee 5 سال پیش
والد
کامیت
315fdb8f69
1فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 7 2
      src/views/quality/defectStatistics.vue

+ 7 - 2
src/views/quality/defectStatistics.vue

@@ -380,10 +380,15 @@ export default {
         this.echartsOption1 = {
           color: ['#3AA1FF'],
           tooltip: { trigger: 'axis', axisPointer: { type: 'line' }}, // 默认为直线,可选为:'line' | 'shadow'
-          grid: { left: '0', right: '0', top: '3%', bottom: '0', containLabel: true },
+          grid: { left: '0', right: '0', top: '5%', bottom: '0', containLabel: true },
           xAxis: [{ type: 'category', data: this.chart1Data.xaxis, axisTick: { alignWithLabel: true }}],
           yAxis: [{ type: 'value', axisLine: { show: false }, splitLine: { lineStyle: { type: 'dashed' }}}],
-          series: [{ name: '缺陷数量', type: 'bar', barWidth: '20px', data: this.chart1Data.yaxis[0] && this.chart1Data.yaxis[0].data || [] }]
+          series: [
+            {
+              name: '缺陷数量', type: 'bar', barWidth: '20px', data: this.chart1Data.yaxis[0] && this.chart1Data.yaxis[0].data || [],
+              itemStyle: { normal: { label: { show: true, formatter: '{b} : {c}', position: 'top' }}}
+            }
+          ]
         }
       } else {
         const newArr = this.chart1Data.xaxis.map((item, index) => {