|
@@ -386,7 +386,8 @@ export default {
|
|
Source:this.chartInfo.Source,//图表来源,和MyChartType一起确定是什么图
|
|
Source:this.chartInfo.Source,//图表来源,和MyChartType一起确定是什么图
|
|
Instructions: this.chartInfo.Instructions,
|
|
Instructions: this.chartInfo.Instructions,
|
|
SourcesFrom: this.chartInfo.SourcesFrom,
|
|
SourcesFrom: this.chartInfo.SourcesFrom,
|
|
- ChartThemeStyle: this.chartInfo.ChartThemeStyle
|
|
|
|
|
|
+ ChartThemeStyle: this.chartInfo.ChartThemeStyle,
|
|
|
|
+ ChartAlias:this.chartInfo.ChartAlias||'',//图表别名
|
|
}
|
|
}
|
|
this.optionMap[id] = { ...defaultOpts, ...this.options,...otherOpts };
|
|
this.optionMap[id] = { ...defaultOpts, ...this.options,...otherOpts };
|
|
}else{
|
|
}else{
|
|
@@ -719,7 +720,7 @@ export default {
|
|
/* if(!$(`#${refName}`)[0]) return */
|
|
/* if(!$(`#${refName}`)[0]) return */
|
|
/*
|
|
/*
|
|
Source:1
|
|
Source:1
|
|
- MyChartType: 2 季节性图,7 柱形图, 10 截面散点图,
|
|
|
|
|
|
+ MyChartType: 2 季节性图,7 柱形图, 10 截面散点图,11 雷达图
|
|
Source:2
|
|
Source:2
|
|
MyChartType: 8 商品价格曲线图
|
|
MyChartType: 8 商品价格曲线图
|
|
Source:5
|
|
Source:5
|
|
@@ -727,9 +728,16 @@ export default {
|
|
Source:6 拟合方程曲线
|
|
Source:6 拟合方程曲线
|
|
Source:7 统计特征
|
|
Source:7 统计特征
|
|
以上图表需要显示标题
|
|
以上图表需要显示标题
|
|
|
|
+
|
|
|
|
+ Source:1
|
|
|
|
+ MyChartType:1 曲线图 5 散点图 6组合图
|
|
|
|
+ 以上图表需要显示别名
|
|
|
|
+
|
|
|
|
+ 后端控制->通过新字段来判断是否显示标题/别名
|
|
*/
|
|
*/
|
|
const {Source,MyChartType,ChartThemeStyle} = options
|
|
const {Source,MyChartType,ChartThemeStyle} = options
|
|
const isShowTitle = isShowPPTTitle(Source,MyChartType)
|
|
const isShowTitle = isShowPPTTitle(Source,MyChartType)
|
|
|
|
+ const isShowOtherTitle = Source===1&&[1,5,6].includes(MyChartType)
|
|
|
|
|
|
/* 主题样式*/
|
|
/* 主题样式*/
|
|
const chartTheme = ChartThemeStyle ? JSON.parse(ChartThemeStyle) : null;
|
|
const chartTheme = ChartThemeStyle ? JSON.parse(ChartThemeStyle) : null;
|
|
@@ -770,16 +778,16 @@ export default {
|
|
//一行可容纳的中文字体数
|
|
//一行可容纳的中文字体数
|
|
const fontSize = chartTheme?chartTheme.titleOptions.style.fontSize:16
|
|
const fontSize = chartTheme?chartTheme.titleOptions.style.fontSize:16
|
|
let count = parseInt($(`#${refName}`)[0].offsetWidth / fontSize)*1.75
|
|
let count = parseInt($(`#${refName}`)[0].offsetWidth / fontSize)*1.75
|
|
- let {total,newStr} = getStrSize(options.MyChartTitle,count)
|
|
|
|
|
|
+ let {total,newStr} = getStrSize(isShowTitle?options.MyChartTitle:isShowOtherTitle?options.ChartAlias:'',count)
|
|
const isPublish = this.$route.path==='/pptpublish'||this.$route.path==='/pptenpublish'
|
|
const isPublish = this.$route.path==='/pptpublish'||this.$route.path==='/pptenpublish'
|
|
- if(isShowTitle){
|
|
|
|
|
|
+ if(isShowTitle||(isShowOtherTitle&&options.ChartAlias.length)){
|
|
titleHTML = `<div style="
|
|
titleHTML = `<div style="
|
|
text-align:${chartTheme&&chartTheme.titleOptions.align};
|
|
text-align:${chartTheme&&chartTheme.titleOptions.align};
|
|
font-size:${chartTheme&&chartTheme.titleOptions.style.fontSize}px;
|
|
font-size:${chartTheme&&chartTheme.titleOptions.style.fontSize}px;
|
|
color:${chartTheme&&chartTheme.titleOptions.style.color};
|
|
color:${chartTheme&&chartTheme.titleOptions.style.color};
|
|
min-height:18px;word-break: break-all;
|
|
min-height:18px;word-break: break-all;
|
|
">
|
|
">
|
|
- ${options.MyChartTitle}
|
|
|
|
|
|
+ ${isShowTitle?options.MyChartTitle:isShowOtherTitle?options.ChartAlias:''}
|
|
</div>`
|
|
</div>`
|
|
}
|
|
}
|
|
let SpecialOption = {
|
|
let SpecialOption = {
|
|
@@ -797,7 +805,7 @@ export default {
|
|
},
|
|
},
|
|
colors: options.colors||chartTheme&&chartTheme.colorsOptions||defaultOpts.colors,
|
|
colors: options.colors||chartTheme&&chartTheme.colorsOptions||defaultOpts.colors,
|
|
title: isPublish?{
|
|
title: isPublish?{
|
|
- text: isShowTitle?newStr:null,
|
|
|
|
|
|
+ text: (isShowTitle||(isShowOtherTitle&&options.ChartAlias.length))?newStr:null,
|
|
margin:5,
|
|
margin:5,
|
|
useHTML:false,
|
|
useHTML:false,
|
|
style:{...chartTheme&&chartTheme.titleOptions.style},
|
|
style:{...chartTheme&&chartTheme.titleOptions.style},
|