From c7aece35a62b6e91fd98a625bf0e53f64bfbd18d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 17 八月 2023 16:22:15 +0800
Subject: [PATCH] 2023-08-17

---
 src/templates/sharecomponent/chartcomponent/index.jsx |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/templates/sharecomponent/chartcomponent/index.jsx b/src/templates/sharecomponent/chartcomponent/index.jsx
index f35533c..f2a0771 100644
--- a/src/templates/sharecomponent/chartcomponent/index.jsx
+++ b/src/templates/sharecomponent/chartcomponent/index.jsx
@@ -4,8 +4,6 @@
 import { Chart } from '@antv/g2'
 import DataSet from '@antv/data-set'
 
-import zhCN from '@/locales/zh-CN/model.js'
-import enUS from '@/locales/en-US/model.js'
 import ChartCompileForm from './chartcompile'
 import './index.scss'
 
@@ -17,7 +15,6 @@
   }
 
   state = {
-    dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS,
     visible: true
   }
 
@@ -420,6 +417,9 @@
         if (plot.label === 'true') {
           _chart.label('value')
         }
+        if (plot.barSize || plot.correction) {
+          _chart.size(plot.barSize || 35)
+        }
       } else if (plot.adjust === 'stack') {
         let _chart = chart
           .interval()
@@ -430,6 +430,10 @@
   
         if (plot.label === 'true') {
           _chart.label('value')
+        }
+
+        if (plot.barSize || plot.correction) {
+          _chart.size(plot.barSize || 35)
         }
       }
   
@@ -531,11 +535,6 @@
             type: 'overlap'
           }
           setting.offset = 0
-          // setting.style = {
-          //   textAlign: 'center',
-          //   fontSize: 12,
-          //   fill: '#535353'
-          // }
         }
 
         _chart.label('percent', setting)
@@ -601,6 +600,10 @@
     this.props.plotchange({...config, charts: _charts})
   }
 
+  shouldComponentUpdate (nextProps, nextState) {
+    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
+  }
+
   render() {
     const { plot } = this.props
 
@@ -612,7 +615,6 @@
           plot={plot}
           type={plot.chartType}
           config={this.props.config}
-          dict={this.state.dict}
           plotchange={this.plotChange}
         />
       </div>

--
Gitblit v1.8.0