|
@@ -97,6 +97,10 @@ export default {
|
|
|
|
|
|
/* 曲线 */
|
|
|
setDefaultChart() {
|
|
|
+
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
//拼接标题 数据列
|
|
|
let data = [],
|
|
|
ydata = [];
|
|
@@ -115,7 +119,9 @@ export default {
|
|
|
text: item.Unit,
|
|
|
textCh:item.Unit,//中文单位
|
|
|
textEn:item.Unit?item.UnitEn:'',//英文单位,但如果无中文单位则不显示
|
|
|
- // text: null,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
@@ -131,15 +137,17 @@ export default {
|
|
|
align: 'center',
|
|
|
x: [0,2].includes(item.IsAxis) ? 5 : -5,
|
|
|
style: {
|
|
|
- fontSize: '10px',
|
|
|
- },
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style,
|
|
|
+ }
|
|
|
},
|
|
|
opposite: [0,2].includes(item.IsAxis),
|
|
|
reversed: item.IsOrder,
|
|
|
min: Number(item.MinData),
|
|
|
max: Number(item.MaxData),
|
|
|
tickWidth: 1,
|
|
|
- visible: sameSideIndex === index
|
|
|
+ visible: sameSideIndex === index,
|
|
|
+ plotBands: this.setAxisPlotAreas(item.IsAxis),
|
|
|
+ plotLines: this.setAxisPlotLines(item.IsAxis)
|
|
|
};
|
|
|
|
|
|
// //拼接标题 判断相同指标名称拼接来源
|
|
@@ -163,13 +171,14 @@ export default {
|
|
|
//数据列
|
|
|
let obj = {
|
|
|
data: [],
|
|
|
- type: 'spline',
|
|
|
+ type: (chartTheme&&chartTheme.lineOptions.lineType) || 'spline',
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
yAxis: sameSideIndex,
|
|
|
name:nameCh,
|
|
|
nameCh:nameCh,
|
|
|
nameEn:nameEn,
|
|
|
color: item.ChartColor,
|
|
|
- lineWidth: Number(item.ChartWidth),
|
|
|
+ lineWidth: Number(item.ChartWidth)||(chartTheme&&chartTheme.lineOptions.lineWidth),
|
|
|
...predict_params
|
|
|
};
|
|
|
item.DataList = item.DataList || [];
|
|
@@ -191,7 +200,12 @@ export default {
|
|
|
? Highcharts.dateFormat('%m/%d', ctx.value)
|
|
|
: Highcharts.dateFormat('%y/%m', ctx.value);
|
|
|
},
|
|
|
- }
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ plotBands: this.setAxisPlotAreas(3,'datetime'),
|
|
|
+ plotLines: this.setAxisPlotLines(3,'datetime')
|
|
|
}
|
|
|
|
|
|
this.options = {
|
|
@@ -230,6 +244,9 @@ export default {
|
|
|
};
|
|
|
let chartStyle = chartTypeMap[this.chartInfo.ChartType];
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
//拼接标题 数据列
|
|
|
let data = [],
|
|
|
ydata = [];
|
|
@@ -260,11 +277,12 @@ export default {
|
|
|
let yItem = {
|
|
|
...basicYAxis,
|
|
|
title: {
|
|
|
- //text: sameSideIndex !== index ? '' : `${item.Unit}`,
|
|
|
text:item.Unit,
|
|
|
textCh:item.Unit,//中文单位
|
|
|
textEn:item.Unit?item.UnitEn:'',//英文单位,但如果无中文单位则不显示
|
|
|
- // text: null,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
@@ -280,15 +298,17 @@ export default {
|
|
|
align: 'center',
|
|
|
x: [0,2].includes(item.IsAxis) ? 5 : -5,
|
|
|
style: {
|
|
|
- fontSize: '10px',
|
|
|
- },
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ }
|
|
|
},
|
|
|
opposite: [0,2].includes(item.IsAxis),
|
|
|
reversed: item.IsOrder,
|
|
|
min: Number(chartData[sameSideIndex].MinData),
|
|
|
max: Number(chartData[sameSideIndex].MaxData),
|
|
|
tickWidth: sameSideIndex !== index ? 0 : 1,
|
|
|
- visible: serie_yIndex === index && sameSideIndex ===index
|
|
|
+ visible: serie_yIndex === index && sameSideIndex ===index,
|
|
|
+ plotBands: this.setAxisPlotAreas(item.IsAxis),
|
|
|
+ plotLines: this.setAxisPlotLines(item.IsAxis)
|
|
|
};
|
|
|
|
|
|
// //拼接标题 判断相同指标名称拼接来源
|
|
@@ -319,11 +339,11 @@ export default {
|
|
|
nameCh:nameCh,
|
|
|
nameEn:nameEn,
|
|
|
color: item.ChartColor,
|
|
|
- lineWidth: (this.chartInfo.ChartType === 6 && item.ChartStyle === 'spline') ? Number(item.ChartWidth) : 0,
|
|
|
- fillColor: (this.chartInfo.ChartType === 3 || (this.chartInfo.ChartType === 6 && item.ChartStyle === 'areaspline')) ? item.ChartColor : undefined,
|
|
|
+ lineWidth: Number(item.ChartWidth),
|
|
|
+ // fillColor: (this.chartInfo.ChartType === 3 || (this.chartInfo.ChartType === 6 && item.ChartStyle === 'areaspline')) ? item.ChartColor : undefined,
|
|
|
borderWidth: 1,
|
|
|
borderColor: item.ChartColor,
|
|
|
- zIndex: (this.chartInfo.ChartType === 6 && item.ChartStyle === 'spline') ? 1 : 0, //防止组合图曲线被遮住
|
|
|
+ zIndex: (this.chartInfo.ChartType === 6 && ['line','spline'].includes(item.ChartStyle)) ? 1 : 0, //防止组合图曲线被遮住
|
|
|
...predict_params
|
|
|
};
|
|
|
item.DataList = item.DataList || [];
|
|
@@ -339,13 +359,18 @@ export default {
|
|
|
let isLessThanOneYear = this.xTimeDiffer();
|
|
|
let xAxis = {
|
|
|
...defaultOpts.xAxis,
|
|
|
- labels: {
|
|
|
+ labels: {
|
|
|
formatter: function (ctx) {
|
|
|
return isLessThanOneYear
|
|
|
? Highcharts.dateFormat('%m/%d', ctx.value)
|
|
|
: Highcharts.dateFormat('%y/%m', ctx.value);
|
|
|
},
|
|
|
- }
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ plotBands: this.setAxisPlotAreas(3,'datetime'),
|
|
|
+ plotLines: this.setAxisPlotLines(3,'datetime')
|
|
|
}
|
|
|
|
|
|
this.options = {
|
|
@@ -360,6 +385,9 @@ export default {
|
|
|
/* 季节性图的图表配置 */
|
|
|
const chartData = this.dataList[0];
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
|
|
|
// 农历数据需要去除第一项 在ETA1.0.5之后,除了这里 农历和公历处理逻辑一样
|
|
|
const temChartDataList=chartData.DataList||[]
|
|
@@ -376,9 +404,11 @@ export default {
|
|
|
|
|
|
let serie_item = {
|
|
|
data: [],
|
|
|
- type: chartData.ChartStyle,
|
|
|
+ type: (chartTheme&&chartTheme.lineOptions.lineType) || chartData.ChartStyle,
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
yAxis: 0,
|
|
|
name: j.ChartLegend,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptions.lineWidth) || 1,
|
|
|
...predict_params
|
|
|
};
|
|
|
const data_array = _.cloneDeep(j.DataList);
|
|
@@ -398,14 +428,18 @@ export default {
|
|
|
return val;
|
|
|
},
|
|
|
align: 'center',
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ }
|
|
|
},
|
|
|
title: {
|
|
|
text: `${chartData.Unit}`,
|
|
|
textCh:chartData.Unit, // 中文
|
|
|
// 中文不存在,无论英文有无都显示空
|
|
|
textEn:chartData.UnitEn||chartData.Unit, // 英文
|
|
|
- style:{},
|
|
|
- styleEn:{}, // 英文样式
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
// text: null,
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
@@ -416,6 +450,8 @@ export default {
|
|
|
},
|
|
|
max: Number(chartData.MaxData),
|
|
|
min: Number(chartData.MinData),
|
|
|
+ plotBands: this.setAxisPlotAreas(1),
|
|
|
+ plotLines: this.setAxisPlotLines(1)
|
|
|
}];
|
|
|
|
|
|
// 季节图x轴显示月/日 周度指标额外处理时间轴显示
|
|
@@ -426,9 +462,11 @@ export default {
|
|
|
return Highcharts.dateFormat('%m/%d', ctx.value);
|
|
|
},
|
|
|
style: {
|
|
|
- fontSize: '10px',
|
|
|
- },
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
},
|
|
|
+ plotBands: this.setAxisPlotAreas(3,'datetime'),
|
|
|
+ plotLines: this.setAxisPlotLines(3,'datetime')
|
|
|
};
|
|
|
|
|
|
const tooltip = {
|
|
@@ -444,7 +482,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.options = {
|
|
|
- colors:seasonOptions.colors.slice(-chartDataHandle.length),
|
|
|
+ colors:chartTheme&&chartTheme.colorsOptions.slice(-chartDataHandle.length),
|
|
|
series: seasonData,
|
|
|
yAxis: seasonYdata,
|
|
|
xAxis,
|
|
@@ -456,6 +494,9 @@ export default {
|
|
|
setScatterChart() {
|
|
|
const chartData = _.cloneDeep(this.dataList);
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
// 取2个指标中日期相同的数据
|
|
|
let real_data = [];
|
|
|
let tmpData_date = {};//用来取点对应的日期
|
|
@@ -517,7 +558,9 @@ export default {
|
|
|
text: `${chartData[1].Unit}`,
|
|
|
textCh:chartData[1].Unit,
|
|
|
textEn:chartData[1].Unit?chartData[1].UnitEn:'',
|
|
|
- // text: null,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
@@ -528,6 +571,9 @@ export default {
|
|
|
return ctx.value;
|
|
|
},
|
|
|
align: 'center',
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
opposite: false,
|
|
|
reversed: IsOrder,
|
|
@@ -545,7 +591,9 @@ export default {
|
|
|
endOnTick: false,
|
|
|
startOnTick: false,
|
|
|
showLastLabel: true,
|
|
|
- tickPixelInterval: 50
|
|
|
+ tickPixelInterval: 50,
|
|
|
+ plotBands: this.setAxisPlotAreas(1),
|
|
|
+ plotLines: this.setAxisPlotLines(1)
|
|
|
}
|
|
|
|
|
|
//数据列
|
|
@@ -557,7 +605,9 @@ export default {
|
|
|
nameEn:this.chartInfo.ChartNameEn?`${this.chartInfo.ChartNameEn}${IsOrder ? '(reverse)' : ''}`:'',
|
|
|
chartType: 'linear',
|
|
|
color: ChartColor,
|
|
|
- lineWidth: 0
|
|
|
+ marker: {
|
|
|
+ radius: (chartTheme&&chartTheme.lineOptions.radius)||5,
|
|
|
+ },
|
|
|
}
|
|
|
real_data.forEach(_ => {
|
|
|
series.data.push([_.x,_.y])
|
|
@@ -575,12 +625,21 @@ export default {
|
|
|
text: `${chartData[0].Unit}`,
|
|
|
textCh:chartData[0].Unit,
|
|
|
textEn:chartData[0].Unit?chartData[0].UnitEn:'',
|
|
|
- // text: null,
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ },
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
x: 0,
|
|
|
offset: 15,
|
|
|
},
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ plotBands: this.setAxisPlotAreas(3),
|
|
|
+ plotLines: this.setAxisPlotLines(3)
|
|
|
},
|
|
|
tooltip
|
|
|
}
|
|
@@ -594,18 +653,19 @@ export default {
|
|
|
let seriesData = [];
|
|
|
const data = _.cloneDeep(this.barDateList);
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
//x轴
|
|
|
let xAxis = {
|
|
|
...scatterXAxis,
|
|
|
categories: this.barXIdData.map(_ => this.barEdbData.find(edb => edb.EdbInfoId===_).EdbAliasName),
|
|
|
tickWidth: 1,
|
|
|
- title: {
|
|
|
- text: ``,
|
|
|
- align: 'high',
|
|
|
- rotation: 0,
|
|
|
- x: 0,
|
|
|
- offset: 20,
|
|
|
- },
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const { max,min } = this.chartLimit;
|
|
@@ -619,7 +679,12 @@ export default {
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
|
- offset: 0,
|
|
|
+ x:0,
|
|
|
+ textAlign: 'left',
|
|
|
+ reserveSpace: false,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
labels: {
|
|
|
formatter: function (ctx) {
|
|
@@ -627,11 +692,16 @@ export default {
|
|
|
return val;
|
|
|
},
|
|
|
align: 'center',
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
min: Number(min),
|
|
|
max: Number(max),
|
|
|
opposite: false,
|
|
|
tickWidth: 1,
|
|
|
+ plotBands: this.setAxisPlotAreas(1),
|
|
|
+ plotLines: this.setAxisPlotLines(1)
|
|
|
}
|
|
|
|
|
|
//数据列
|
|
@@ -687,18 +757,19 @@ export default {
|
|
|
let seriesData = [];
|
|
|
const data = _.cloneDeep(this.commodityChartData);
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
//x轴
|
|
|
let xAxis = {
|
|
|
...scatterXAxis,
|
|
|
categories: this.commodityXData.map(_ =>_.Name),
|
|
|
tickWidth: 1,
|
|
|
- title: {
|
|
|
- text: ``,
|
|
|
- align: 'high',
|
|
|
- rotation: 0,
|
|
|
- x: 0,
|
|
|
- offset: 20,
|
|
|
- },
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const { max,min } = this.chartLimit;
|
|
@@ -712,7 +783,11 @@ export default {
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
|
- offset: 0,
|
|
|
+ textAlign: 'left',
|
|
|
+ reserveSpace: false,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
labels: {
|
|
|
formatter: function (ctx) {
|
|
@@ -720,6 +795,9 @@ export default {
|
|
|
return val;
|
|
|
},
|
|
|
align: 'center',
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
min: Number(min),
|
|
|
max: Number(max),
|
|
@@ -734,14 +812,15 @@ export default {
|
|
|
|
|
|
let serie_item = {
|
|
|
data: filterData,
|
|
|
- type: 'spline',
|
|
|
+ type: (chartTheme&&chartTheme.lineOptions.lineType) || 'spline',
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
yAxis: 0,
|
|
|
name: item.Name,
|
|
|
nameCh: item.Name,
|
|
|
nameEn: item.NameEn,
|
|
|
color: item.Color,
|
|
|
chartType: 'linear',
|
|
|
- lineWidth: 3,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptions.lineWidth) || 3,
|
|
|
marker: {
|
|
|
enabled: false
|
|
|
}
|
|
@@ -882,6 +961,10 @@ export default {
|
|
|
|
|
|
/* 相关性图表初始化 */
|
|
|
initRelevanceChartData(){
|
|
|
+
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
// 处理X轴
|
|
|
let xAxis={
|
|
|
categories: this.relevanceChartData.XEdbIdValue,
|
|
@@ -892,9 +975,14 @@ export default {
|
|
|
textEn:this.relevanceChartData.ChartInfo.Source===3 ? `stage(${this.relevanceUnitEnMap[this.relevanceChartData.CorrelationChartInfo.LeadUnit]})`:null,
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
- x: 0,
|
|
|
- y:10,
|
|
|
- offset: 20,
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
},
|
|
|
tickInterval: 1,
|
|
|
offset:0,
|
|
@@ -911,7 +999,11 @@ export default {
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
|
- offset: 0,
|
|
|
+ textAlign: 'left',
|
|
|
+ reserveSpace: false,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
labels: {
|
|
|
formatter: function (ctx) {
|
|
@@ -919,12 +1011,12 @@ export default {
|
|
|
return val;
|
|
|
},
|
|
|
align: 'center',
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
- // min: -1,
|
|
|
- // max: 1,
|
|
|
opposite: false,
|
|
|
tickWidth: 1,
|
|
|
- // tickInterval:0.2,
|
|
|
}
|
|
|
|
|
|
//处理series
|
|
@@ -932,14 +1024,15 @@ export default {
|
|
|
this.relevanceChartData.YDataList.forEach(item=>{
|
|
|
let serie_item = {
|
|
|
data: item.Value,
|
|
|
- type: 'spline',
|
|
|
+ type: (chartTheme&&chartTheme.lineOptions.lineType) || 'spline',
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
yAxis: 0,
|
|
|
name: item.Name,
|
|
|
nameCh: item.Name,
|
|
|
nameEn: item.NameEn,
|
|
|
color: item.Color,
|
|
|
chartType: 'linear',
|
|
|
- lineWidth: 3,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptions.lineWidth) || 3,
|
|
|
marker: {
|
|
|
enabled: false
|
|
|
}
|
|
@@ -995,6 +1088,9 @@ export default {
|
|
|
const { DataList,XName,XNameEn,XUnitName,XUnitNameEn,YName,YNameEn,YUnitName,YUnitNameEn } = this.sectionScatterData;
|
|
|
const { min,max,x_min,x_max } = this.chartLimit;
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
//y轴
|
|
|
let yAxis = {
|
|
|
...basicYAxis,
|
|
@@ -1002,15 +1098,23 @@ export default {
|
|
|
text: YName,
|
|
|
textCh:YName,// 中文
|
|
|
textEn:YNameEn,
|
|
|
- style:{},
|
|
|
- styleEn:{cursor:'pointer'},
|
|
|
align: 'middle',
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
+ },
|
|
|
+ labels: {
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
opposite: false,
|
|
|
reversed: false,
|
|
|
min: Number(min),
|
|
|
max: Number(max),
|
|
|
tickWidth: 1,
|
|
|
+ plotBands: this.setAxisPlotAreas(1),
|
|
|
+ plotLines: this.setAxisPlotLines(1)
|
|
|
}
|
|
|
|
|
|
//x轴
|
|
@@ -1020,12 +1124,20 @@ export default {
|
|
|
text: XName,
|
|
|
textCh:XName,// 中文
|
|
|
textEn:XNameEn,
|
|
|
- style:{},
|
|
|
- styleEn:{cursor:'pointer'},
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ },
|
|
|
align: 'middle',
|
|
|
},
|
|
|
+ labels: {
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ },
|
|
|
+ },
|
|
|
min: Number(x_min),
|
|
|
max: Number(x_max),
|
|
|
+ plotBands: this.setAxisPlotAreas(3),
|
|
|
+ plotLines: this.setAxisPlotLines(3)
|
|
|
}
|
|
|
|
|
|
//数据列
|
|
@@ -1041,7 +1153,10 @@ export default {
|
|
|
color: item.Color,
|
|
|
lineWidth: 0,
|
|
|
chartType: 'linear',
|
|
|
- zIndex:1
|
|
|
+ zIndex:1,
|
|
|
+ marker: {
|
|
|
+ radius: (chartTheme&&chartTheme.lineOptions.radius)||5,
|
|
|
+ },
|
|
|
}
|
|
|
item.EdbInfoList.forEach(_ => {
|
|
|
series_item.data.push({
|
|
@@ -1158,17 +1273,18 @@ export default {
|
|
|
/* 统计频率图 */
|
|
|
setStatisticFrequency() {
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
const { DataList,LeftMaxValue,LeftMinValue,RightMaxValue,RightMinValue } = this.statisticFrequencyData;
|
|
|
|
|
|
let xAxis = {
|
|
|
...scatterXAxis,
|
|
|
tickWidth: 1,
|
|
|
- title: {
|
|
|
- text: ``,
|
|
|
- align: 'high',
|
|
|
- rotation: 0,
|
|
|
- x: 0,
|
|
|
- offset: 20,
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1184,7 +1300,15 @@ export default {
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
|
- offset: 0,
|
|
|
+ reserveSpace: false,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
+ },
|
|
|
+ labels: {
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
opposite: item.IsAxis===1?false:true,
|
|
|
min: index===0? Number(LeftMinValue):Number(RightMinValue),
|
|
@@ -1194,13 +1318,14 @@ export default {
|
|
|
|
|
|
let series_item = {
|
|
|
data: item.Value.map(_ =>[_.X,_.Y]),
|
|
|
- type: 'spline',
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
+ type: (chartTheme&&chartTheme.lineOptions.lineType) || 'spline',
|
|
|
yAxis: index,
|
|
|
name: item.Name,
|
|
|
nameCh: item.Name,
|
|
|
nameEn: item.NameEn||item.Name,
|
|
|
color: item.Color,
|
|
|
- lineWidth: 3,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptions.lineWidth)||3,
|
|
|
chartType: 'linear',
|
|
|
zIndex:1
|
|
|
}
|
|
@@ -1242,6 +1367,9 @@ export default {
|
|
|
|
|
|
const { DataList,XName,YName,XNameEn,YNameEn } = this.crossVarietyChartData;
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
//y轴
|
|
|
let yAxis = {
|
|
|
...basicYAxis,
|
|
@@ -1250,6 +1378,14 @@ export default {
|
|
|
textCh:YName,// 中文
|
|
|
textEn:YNameEn||YName,
|
|
|
align: 'middle',
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
},
|
|
|
opposite: false,
|
|
|
reversed: false,
|
|
@@ -1266,6 +1402,14 @@ export default {
|
|
|
textCh:XName,// 中文
|
|
|
textEn:XNameEn || XName,
|
|
|
align: 'middle',
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
},
|
|
|
min: Number(x_min),
|
|
|
max: Number(x_max),
|
|
@@ -1282,7 +1426,6 @@ export default {
|
|
|
nameCh: item.Name,
|
|
|
nameEn: item.NameEn||item.Name,
|
|
|
color: item.Color,
|
|
|
- lineWidth: 0,
|
|
|
chartType: 'linear',
|
|
|
zIndex:1
|
|
|
}
|
|
@@ -1449,6 +1592,94 @@ export default {
|
|
|
}]
|
|
|
}
|
|
|
: {}
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 处理轴的标识线结构 在指定轴位置上拼接标识线
|
|
|
+ 0:右轴 1:左轴 2:右2轴 x轴固定3
|
|
|
+ axisType表示x轴类型 处理时间轴的值 datetime/null
|
|
|
+ */
|
|
|
+ setAxisPlotLines(axis,axisType=null) {
|
|
|
+ const { MarkersLines,ChartType } = this.chartInfo;
|
|
|
+ if(!MarkersLines) return []
|
|
|
+
|
|
|
+ let markerLines = JSON.parse(MarkersLines);
|
|
|
+
|
|
|
+ let arr = markerLines.filter(_ => _.isShow&&_.axis===axis)
|
|
|
+ let plotLines = arr.map(_ => {
|
|
|
+ //是否是x时间轴
|
|
|
+ let isXDateAxis = axis===3&&axisType==='datetime';
|
|
|
+ let markerValue='';
|
|
|
+ if(isXDateAxis) {
|
|
|
+ //季节图x轴额外拼个年份
|
|
|
+ let nowYear = new Date().getFullYear();
|
|
|
+ markerValue = ChartType===2
|
|
|
+ ? new Date(`${nowYear}-${_.value}`).getTime()
|
|
|
+ : new Date(_.value).getTime()
|
|
|
+ }else {
|
|
|
+ markerValue = Number(_.value)
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ value: markerValue,
|
|
|
+ dashStyle: _.dashStyle,
|
|
|
+ width: Number(_.lineWidth),
|
|
|
+ color: _.color,
|
|
|
+ label: {
|
|
|
+ text: _.text||'',
|
|
|
+ verticalAlign: _.textPosition,
|
|
|
+ style: {
|
|
|
+ color: _.textColor,
|
|
|
+ fontSize: _.textFontSize
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return plotLines
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 处理标识区拼接 axisType表示x轴类型处理时间轴的值 datetime/null */
|
|
|
+ setAxisPlotAreas(axis,axisType=null) {
|
|
|
+ const { MarkersAreas,ChartType } = this.chartInfo;
|
|
|
+ if(!MarkersAreas) return []
|
|
|
+
|
|
|
+ let markerAreas = JSON.parse(MarkersAreas);
|
|
|
+
|
|
|
+ let arr = markerAreas.filter(_ => _.isShow&&_.axis===axis)
|
|
|
+ let plotBands = arr.map(_ => {
|
|
|
+ //是否是x时间轴
|
|
|
+ let isXDateAxis = axis===3&&axisType==='datetime';
|
|
|
+ let fromMarkerValue='',toMarkerValue='';
|
|
|
+ if(isXDateAxis) {
|
|
|
+ //季节图x轴额外拼个年份
|
|
|
+ let nowYear = new Date().getFullYear();
|
|
|
+ fromMarkerValue = ChartType===2
|
|
|
+ ? new Date(`${nowYear}-${_.fromValue}`).getTime()
|
|
|
+ : new Date(_.fromValue).getTime()
|
|
|
+
|
|
|
+ toMarkerValue = ChartType===2
|
|
|
+ ? new Date(`${nowYear}-${_.toValue}`).getTime()
|
|
|
+ : new Date(_.toValue).getTime()
|
|
|
+ }else {
|
|
|
+ fromMarkerValue = Number(_.fromValue);
|
|
|
+ toMarkerValue = Number(_.toValue);
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ from: fromMarkerValue,
|
|
|
+ to: toMarkerValue,
|
|
|
+ color: _.color,
|
|
|
+ label: {
|
|
|
+ text: _.text||'',
|
|
|
+ verticalAlign: _.textPosition,
|
|
|
+ style: {
|
|
|
+ color: _.textColor,
|
|
|
+ fontSize: _.textFontSize
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ return plotBands
|
|
|
}
|
|
|
},
|
|
|
};
|