|
@@ -930,18 +930,34 @@ export default {
|
|
|
},
|
|
|
|
|
|
/* 生成ppt时图表追加底部文字 来源/说明 */
|
|
|
- transChartBottomInfo({slide,x,y,width,height},data) {
|
|
|
- // console.log(slide,x,y,width,height)
|
|
|
- if(data.SourcesFrom&&JSON.parse(data.SourcesFrom).isShow) {
|
|
|
- let sourceObj = JSON.parse(data.SourcesFrom);
|
|
|
+ transChartBottomInfo(slide,{x,y,width,height},data) {
|
|
|
+ let chartData = data;
|
|
|
+ let yPercent = Number(Math.ceil(height.replace(/%/,''))+Math.ceil(y.replace(/%/,'')))+'%';
|
|
|
+ // console.log(yPercent)
|
|
|
|
|
|
+ if(chartData.SourcesFrom&&JSON.parse(chartData.SourcesFrom).isShow) {
|
|
|
+ let sourceObj = JSON.parse(chartData.SourcesFrom);
|
|
|
slide.addText(`来源:${sourceObj.text}`,{
|
|
|
x:x,
|
|
|
- y:height,
|
|
|
- w:width,
|
|
|
- h:20,
|
|
|
- fontSize: sourceObj.fontSize,
|
|
|
- color: sourceObj.color.includes('rgb') ? rgbaToHex(sourceObj.color).color.substring(1) : '666',
|
|
|
+ y: yPercent,
|
|
|
+ w: width,
|
|
|
+ margin:10,
|
|
|
+ fontSize: sourceObj.fontSize*0.75,
|
|
|
+ color: sourceObj.color.includes('rgb') ? rgbaToHex(sourceObj.color).color.substring(1) : sourceObj.color.indexOf('#')===0 ? sourceObj.color.substring(1): '666',
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if(chartData.Instructions&&JSON.parse(chartData.Instructions).isShow) {
|
|
|
+ let instructObj = JSON.parse(chartData.Instructions);
|
|
|
+
|
|
|
+ slide.addText(instructObj.text,{
|
|
|
+ x:x,
|
|
|
+ y: yPercent,
|
|
|
+ w: width,
|
|
|
+ align:'right',
|
|
|
+ margin:10,
|
|
|
+ fontSize: instructObj.fontSize*0.75,
|
|
|
+ color: instructObj.color.includes('rgb') ? rgbaToHex(instructObj.color).color.substring(1) : instructObj.color.indexOf('#')===0 ? instructObj.color.substring(1): '666',
|
|
|
})
|
|
|
}
|
|
|
}
|