Ver código fonte

图表标题的问题

cxmo 1 ano atrás
pai
commit
e31d698bf7
1 arquivos alterados com 10 adições e 6 exclusões
  1. 10 6
      src/views/ppt_manage/mixins/pptMixins.js

+ 10 - 6
src/views/ppt_manage/mixins/pptMixins.js

@@ -25,6 +25,7 @@ import FormatNine from '../newVersion/components/formatPage/FormatNine.vue';
 import FormatTen from '../newVersion/components/formatPage/FormatTen.vue';
 import FormatEle from '../newVersion/components/formatPage/FormatEle.vue';
 import FormatTwelve from '../newVersion/components/formatPage/FormatTwelve.vue';
+import { marginTop } from "../newVersion/utils/config.js";
 export default {
   components:{ FormatOne,FormatTwo,FormatThree,
     FormatFour,FormatFive,FormatSix,FormatSeven,FormatEight,FormatNine,FormatTen,FormatEle,FormatTwelve},
@@ -548,14 +549,15 @@ export default {
         const isPublish = this.$route.path==='/pptpublish'||this.$route.path==='/pptenpublish'
         if(isShowTitle){
           titleHTML = `<div style="
-            textAlign:${chartTheme&&chartTheme.titleOptions.align};
-            fontSize:${chartTheme&&chartTheme.titleOptions.style.fontSize}px;
-            color:${chartTheme&&chartTheme.titleOptions.style.color}
+            text-align:${chartTheme&&chartTheme.titleOptions.align};
+            font-size:${chartTheme&&chartTheme.titleOptions.style.fontSize}px;
+            color:${chartTheme&&chartTheme.titleOptions.style.color};
+            height:18px;
           ">
             ${options.MyChartTitle}
           </div>`
         }
-
+        const titleOption = isPublish&&isShowTitle?{marginTop:25}:{}
         let SpecialOption = {
           chart: {
             ...defaultOpts.chart,
@@ -564,7 +566,8 @@ export default {
             animation: false,
             backgroundColor: "rgba(0,0,0,0)",
             renderTo:$(`#${refName}`)[0],
-            ...options.chart||{}
+            ...options.chart||{},
+            ...titleOption
           },
           legend: {
             ...defaultOpts.legend,
@@ -575,13 +578,14 @@ export default {
             text: isShowTitle?newStr:null,
             margin:0,
             useHTML:false,
+            floating:true,
             style:{...chartTheme&&chartTheme.titleOptions.style},
             align: (chartTheme&&chartTheme.titleOptions.align) || (total>count?'left':'center'),
           }:{
             text: titleHTML,
             useHTML:true,
             margin:0,
-            style:{left:0}
+            style:{textAlign:chartTheme&&chartTheme.titleOptions.align,left:0,width:'100%'}
           },
           plotOptions: {
             ...defaultOpts.plotOptions,