Browse Source

总体统计图样式设置/饼图样式调整

zhuth 6 years ago
parent
commit
48fa737faa
1 changed files with 9 additions and 2 deletions
  1. 9 2
      src/models/parseChartOption.js

+ 9 - 2
src/models/parseChartOption.js

@@ -130,7 +130,10 @@ function pieOption(data, pieConfig, themeConfig, styleConfig) {
             formatter: "{a} <br/>{b} : {c} ({d}%)"
         },
         legend: {
-            // data: (data.xAxis || []).map(d => d || '空')
+            show: true,
+            orient: 'vertical',
+            right: '30%',
+            top: '100',
             data: data.xAxis.map(d => {
                 let gv= pieConfig.xAxis.granularity.value;
                 let xv = d || '空';
@@ -160,6 +163,8 @@ function pieOption(data, pieConfig, themeConfig, styleConfig) {
             {
                 name: columnName,
                 type: 'pie',
+                center: ['30%', '50%'],
+                radius: [0, '65%'],
                 // radius : '55%',
                 // center: ['50%', '60%'],
                 // data: (data.serieses || [{ value: [] }])[0].value,
@@ -298,7 +303,9 @@ function scatterOption(data, scatterConfig, themeConfig, styleConfig) {
 
 function aggregateTableOption( data, aggregateTableConfig, themeConfig, styleConfig) {
     const resData = data.valueList;
-    const { targetColumn, statistics: statisticsNames, direction } = aggregateTableConfig;
+    const { targetColumn, statistics: statisticsNames } = aggregateTableConfig;
+    const { direction } = styleConfig;
+
     
     let statistics = STATISTICS_OPTION.filter(o => statisticsNames.indexOf(o.value) !== -1);