|
@@ -425,13 +425,15 @@ export default {
|
|
|
/* 添加指标时 配置默认颜色 线条等 */
|
|
|
setAddChartDefault() {
|
|
|
|
|
|
- let themeOpt = JSON.parse(this.chartInfo.ChartThemeStyle);
|
|
|
+ let themeOpt = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
|
|
|
this.tableData.forEach((item,index) => {
|
|
|
- item.ChartColor = item.ChartColor || themeOpt.colorsOptions[index];
|
|
|
- item.PredictChartColor = item.PredictChartColor || themeOpt.colorsOptions[index];
|
|
|
- item.ChartStyle = item.ChartStyle || (themeOpt.lineOptions.lineType||'spline');
|
|
|
- this.tableData[index].ChartWidth = this.tableData[index].ChartWidth || themeOpt.lineOptions.lineWidth;
|
|
|
+ item.ChartColor = item.ChartColor || (themeOpt&&themeOpt.colorsOptions[index]||defaultOpts.colors[index]);
|
|
|
+ item.PredictChartColor = item.PredictChartColor || (themeOpt&&themeOpt.colorsOptions[index]||defaultOpts.colors[index]);
|
|
|
+ item.ChartStyle = item.ChartStyle || (themeOpt&&themeOpt.lineOptions.lineType||'spline');
|
|
|
+
|
|
|
+ let configLineWid = index===0?3:1;//兼容预测指标绘图无主题配置
|
|
|
+ this.tableData[index].ChartWidth = this.tableData[index].ChartWidth || (themeOpt&&themeOpt.lineOptions.lineWidth||configLineWid);
|
|
|
})
|
|
|
},
|
|
|
|