|
@@ -570,10 +570,12 @@ export const chartSetMixin = {
|
|
|
this.rightTwoIndex = newval.findIndex((item) => item.IsAxis ===2);
|
|
|
}
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
//拼接标题 数据列
|
|
|
let data = [];
|
|
|
let ydata = [];
|
|
|
- // let chartData = _.cloneDeep(newval);
|
|
|
//有右二轴时排个序 按照左 右 右2的顺序
|
|
|
let chartData = newval.some(_ =>_.IsAxis===2) ? this.changeEdbOrder(newval) : _.cloneDeep(newval);
|
|
|
|
|
@@ -591,8 +593,9 @@ export const chartSetMixin = {
|
|
|
textCh:item.Unit, // 中文
|
|
|
// 中文不存在,无论英文有无都显示空
|
|
|
textEn:item.UnitEn||item.Unit, // 英文
|
|
|
- style:{},
|
|
|
- styleEn:{}, // 英文样式
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
@@ -605,16 +608,19 @@ export const chartSetMixin = {
|
|
|
return ctx.value;
|
|
|
},
|
|
|
align: 'center',
|
|
|
- x: [0,2].includes(item.IsAxis) ? 5 : -5
|
|
|
+ x: [0,2].includes(item.IsAxis) ? 5 : -5,
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ }
|
|
|
},
|
|
|
opposite: [0,2].includes(item.IsAxis),
|
|
|
reversed: item.IsOrder,
|
|
|
- // // min: Number(chartData[sameSideIndex].MinData),
|
|
|
- // // max: Number(chartData[sameSideIndex].MaxData),
|
|
|
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)
|
|
|
};
|
|
|
|
|
|
//拼接标题 判断相同指标名称拼接来源
|
|
@@ -634,6 +640,7 @@ export const chartSetMixin = {
|
|
|
let obj = {
|
|
|
data: [],
|
|
|
type: 'spline',
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
yAxis: sameSideIndex,
|
|
|
name:
|
|
|
dynamic_arr.length > 1
|
|
@@ -666,7 +673,12 @@ export const chartSetMixin = {
|
|
|
? 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 = {
|
|
@@ -675,8 +687,6 @@ export const chartSetMixin = {
|
|
|
xAxis
|
|
|
};
|
|
|
|
|
|
- console.log(this.options)
|
|
|
-
|
|
|
//滚动相关性独立tooltip
|
|
|
if(this.chartInfo.Source === 4) {
|
|
|
const { LeadValue,LeadUnit } = this.relevanceChartData.CorrelationChartInfo;
|
|
@@ -713,10 +723,12 @@ export const chartSetMixin = {
|
|
|
};
|
|
|
let chartStyle = chartTypeMap[this.chartInfo.ChartType];
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
//拼接标题 数据列
|
|
|
let data = [];
|
|
|
let ydata = [];
|
|
|
- // let chartData = _.cloneDeep(newval);
|
|
|
//有右二轴时排个序 按照左 右 右2的顺序
|
|
|
let chartData = newval.some(_ =>_.IsAxis===2) ? this.changeEdbOrder(newval) : _.cloneDeep(newval);
|
|
|
|
|
@@ -754,13 +766,13 @@ export const chartSetMixin = {
|
|
|
let yItem = {
|
|
|
...basicYAxis,
|
|
|
title: {
|
|
|
- // text: sameSideIndex !== index ? '' : `${item.Unit}`,
|
|
|
text: item.Unit,
|
|
|
textCh:item.Unit, // 中文
|
|
|
// 中文不存在,无论英文有无都显示空
|
|
|
textEn:item.UnitEn||item.Unit, // 英文
|
|
|
- style:{},
|
|
|
- styleEn:{}, // 英文样式
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
@@ -770,19 +782,22 @@ export const chartSetMixin = {
|
|
|
},
|
|
|
labels: {
|
|
|
formatter: function (ctx) {
|
|
|
- // return sameSideIndex !== index ? '' : ctx.value;
|
|
|
return ctx.value;
|
|
|
},
|
|
|
align: 'center',
|
|
|
- x: [0,2].includes(item.IsAxis) ? 5 : -5
|
|
|
+ x: [0,2].includes(item.IsAxis) ? 5 : -5,
|
|
|
+ style: {
|
|
|
+ ...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,
|
|
|
tickWidth: 1,
|
|
|
- visible: serie_yIndex === index && sameSideIndex ===index
|
|
|
+ visible: serie_yIndex === index && sameSideIndex ===index,
|
|
|
+ plotBands: this.setAxisPlotAreas(item.IsAxis),
|
|
|
+ plotLines: this.setAxisPlotLines(item.IsAxis)
|
|
|
};
|
|
|
|
|
|
//拼接标题 判断相同指标名称拼接来源
|
|
@@ -837,7 +852,12 @@ export const chartSetMixin = {
|
|
|
? 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 = {
|
|
@@ -864,6 +884,8 @@ export const chartSetMixin = {
|
|
|
this.isPredictorChart?chartData.DataList.List.filter((item, index) => index > 0):
|
|
|
chartData.DataList.filter((item, index) => index > 0):
|
|
|
chartData.DataList
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
|
|
|
let seasonYdata = [],
|
|
|
seasonData = [];
|
|
@@ -876,8 +898,10 @@ export const chartSetMixin = {
|
|
|
let serie_item = {
|
|
|
data: [],
|
|
|
type: chartData.ChartStyle,
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
yAxis: 0,
|
|
|
name: this.isPredictorChart?j.Year:j.ChartLegend,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptions.lineWidth) || 2,
|
|
|
...predict_params
|
|
|
};
|
|
|
const data_array = this.calendar_type === '农历' && this.isPredictorChart?_.cloneDeep(j.Items):_.cloneDeep(j.DataList);
|
|
@@ -896,14 +920,18 @@ export const chartSetMixin = {
|
|
|
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,
|
|
@@ -914,14 +942,24 @@ export const chartSetMixin = {
|
|
|
},
|
|
|
max: Number(chartData.MaxData),
|
|
|
min: Number(chartData.MinData),
|
|
|
+ plotBands: this.setAxisPlotAreas(1),
|
|
|
+ plotLines: this.setAxisPlotLines(1)
|
|
|
}];
|
|
|
|
|
|
- /* x轴显示月日 提示框显示月日*/
|
|
|
- defaultOpts.xAxis.labels = {
|
|
|
- formatter: function () {
|
|
|
- return Highcharts.dateFormat('%m/%d', this.value);
|
|
|
+ /* x轴显示月日 */
|
|
|
+ const xAxis = {
|
|
|
+ ...defaultOpts.xAxis,
|
|
|
+ labels: {
|
|
|
+ formatter: function () {
|
|
|
+ return Highcharts.dateFormat('%m/%d', this.value);
|
|
|
+ },
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
},
|
|
|
- };
|
|
|
+ plotBands: this.setAxisPlotAreas(3,'datetime'),
|
|
|
+ plotLines: this.setAxisPlotLines(3,'datetime')
|
|
|
+ }
|
|
|
|
|
|
const tooltip = {
|
|
|
...defaultOpts.tooltip,
|
|
@@ -938,6 +976,7 @@ export const chartSetMixin = {
|
|
|
colors:seasonOptions.colors.slice(-chartDataHandle.length),
|
|
|
series: seasonData,
|
|
|
yAxis: seasonYdata,
|
|
|
+ xAxis,
|
|
|
tooltip
|
|
|
};
|
|
|
if(this.currentLang=='en') this.changeOptions()
|
|
@@ -955,6 +994,9 @@ export const chartSetMixin = {
|
|
|
};
|
|
|
console.log('===========:',this.isSetExtremeValue)
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
// 取2个指标中日期相同的数据
|
|
|
let real_data = [];
|
|
|
let tmpData_date = {};//用来取点对应的日期
|
|
@@ -1027,12 +1069,15 @@ export const chartSetMixin = {
|
|
|
textCh:newval[1].Unit,// 中文
|
|
|
// 中文不存在,无论英文有无都显示空
|
|
|
textEn:newval[1].UnitEn||newval[1].Unit, // 英文
|
|
|
- style:{},
|
|
|
- styleEn:{}, // 英文样式
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
|
- offset: -(12 * newval[1].Unit.length),
|
|
|
+ x:0,
|
|
|
+ textAlign: 'left',
|
|
|
+ reserveSpace: false
|
|
|
},
|
|
|
labels: {
|
|
|
formatter: function (ctx) {
|
|
@@ -1040,12 +1085,42 @@ export const chartSetMixin = {
|
|
|
return val;
|
|
|
},
|
|
|
align: 'center',
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
opposite: false,
|
|
|
reversed: IsOrder,
|
|
|
min: Number(newval[0].MinData),
|
|
|
max: Number(newval[0].MaxData),
|
|
|
tickWidth: 1,
|
|
|
+ plotBands: this.setAxisPlotAreas(1),
|
|
|
+ plotLines: this.setAxisPlotLines(1)
|
|
|
+ }
|
|
|
+
|
|
|
+ //x轴
|
|
|
+ const xAxis = {
|
|
|
+ ...scatterXAxis,
|
|
|
+ title: {
|
|
|
+ text: `${newval[0].Unit}`,
|
|
|
+ textCh:newval[0].Unit, // 中文
|
|
|
+ // 中文不存在,无论英文有无都显示空
|
|
|
+ textEn:newval[0].UnitEn||newval[0].Unit, // 英文
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ },
|
|
|
+ align: 'high',
|
|
|
+ rotation: 0,
|
|
|
+ x: 0,
|
|
|
+ offset: 20,
|
|
|
+ },
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ plotBands: this.setAxisPlotAreas(3),
|
|
|
+ plotLines: this.setAxisPlotLines(3)
|
|
|
}
|
|
|
|
|
|
//数据列
|
|
@@ -1056,7 +1131,10 @@ export const chartSetMixin = {
|
|
|
nameCh: `${this.chartInfo.ChartName}${IsOrder ? '(逆序)' : ''}`,
|
|
|
nameEn: `${this.chartInfo.ChartNameEn||this.chartInfo.ChartName}${IsOrder ? '(reverse)' : ''}`,
|
|
|
color: ChartColor,
|
|
|
- lineWidth: 0
|
|
|
+ chartType: 'linear',
|
|
|
+ marker: {
|
|
|
+ radius: (chartTheme&&chartTheme.lineOptions.radius)||5,
|
|
|
+ },
|
|
|
}
|
|
|
real_data.forEach(_ => {
|
|
|
series.data.push([_.x,_.y])
|
|
@@ -1068,22 +1146,7 @@ export const chartSetMixin = {
|
|
|
},
|
|
|
series: [ series ],
|
|
|
yAxis,
|
|
|
- xAxis: {
|
|
|
- ...scatterXAxis,
|
|
|
- title: {
|
|
|
- text: `${newval[0].Unit}`,
|
|
|
- textCh:newval[0].Unit, // 中文
|
|
|
- // 中文不存在,无论英文有无都显示空
|
|
|
- textEn:newval[0].UnitEn||newval[0].Unit, // 英文
|
|
|
- style:{},
|
|
|
- styleEn:{}, // 英文样式
|
|
|
- // text: null,
|
|
|
- align: 'high',
|
|
|
- rotation: 0,
|
|
|
- x: 0,
|
|
|
- offset: 20,
|
|
|
- },
|
|
|
- },
|
|
|
+ xAxis,
|
|
|
tooltip
|
|
|
}
|
|
|
if(this.currentLang=='en') this.changeOptions()
|
|
@@ -1096,18 +1159,19 @@ export const chartSetMixin = {
|
|
|
let seriesData = [];
|
|
|
const data = _.cloneDeep(this.barDateList);
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
//x轴
|
|
|
let xAxis = {
|
|
|
...scatterXAxis,
|
|
|
categories: this.barXData,
|
|
|
tickWidth: 1,
|
|
|
- title: {
|
|
|
- text: ``,
|
|
|
- align: 'high',
|
|
|
- rotation: 0,
|
|
|
- x: 0,
|
|
|
- offset: 20,
|
|
|
- },
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const { max,min } = this.chartLimit;
|
|
@@ -1122,7 +1186,12 @@ export const chartSetMixin = {
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
|
- offset: 0,
|
|
|
+ x:0,
|
|
|
+ textAlign: 'left',
|
|
|
+ reserveSpace: false,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
labels: {
|
|
|
formatter: function (ctx) {
|
|
@@ -1130,11 +1199,16 @@ export const chartSetMixin = {
|
|
|
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)
|
|
|
}
|
|
|
|
|
|
//数据列
|
|
@@ -1178,18 +1252,19 @@ export const chartSetMixin = {
|
|
|
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;
|
|
@@ -1200,10 +1275,14 @@ export const chartSetMixin = {
|
|
|
text: this.commodityEdbList[0].Unit,
|
|
|
textCh: this.commodityEdbList[0].Unit,
|
|
|
textEn: this.commodityEdbList[0].UnitEn||this.commodityEdbList[0].Unit,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
|
- offset: 0,
|
|
|
+ textAlign: 'left',
|
|
|
+ reserveSpace: false
|
|
|
},
|
|
|
labels: {
|
|
|
formatter: function (ctx) {
|
|
@@ -1211,6 +1290,9 @@ export const chartSetMixin = {
|
|
|
return val;
|
|
|
},
|
|
|
align: 'center',
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
min: Number(min),
|
|
|
max: Number(max),
|
|
@@ -1227,6 +1309,7 @@ export const chartSetMixin = {
|
|
|
let serie_item = {
|
|
|
data: filterData,
|
|
|
type: 'spline',
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
yAxis: 0,
|
|
|
name: item.Name,
|
|
|
nameCh: item.Name,
|
|
@@ -1398,6 +1481,10 @@ export const chartSetMixin = {
|
|
|
this.leftIndex = -1;
|
|
|
this.rightIndex = -1;
|
|
|
this.rightTwoIndex = -1;
|
|
|
+
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
// 处理X轴
|
|
|
let xAxis={
|
|
|
categories: this.relevanceChartData.XEdbIdValue,
|
|
@@ -1408,9 +1495,14 @@ export const chartSetMixin = {
|
|
|
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,
|
|
@@ -1427,7 +1519,11 @@ export const chartSetMixin = {
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
|
- offset: 0,
|
|
|
+ textAlign: 'left',
|
|
|
+ reserveSpace: false,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
labels: {
|
|
|
formatter: function (ctx) {
|
|
@@ -1435,12 +1531,12 @@ export const chartSetMixin = {
|
|
|
return val;
|
|
|
},
|
|
|
align: 'center',
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
},
|
|
|
- // min: -1,
|
|
|
- // max: 1,
|
|
|
opposite: false,
|
|
|
tickWidth: 1,
|
|
|
- // tickInterval:0.2,
|
|
|
}
|
|
|
|
|
|
//处理series
|
|
@@ -1449,6 +1545,7 @@ export const chartSetMixin = {
|
|
|
let serie_item = {
|
|
|
data: item.Value,
|
|
|
type: 'spline',
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
yAxis: 0,
|
|
|
name: item.Name,
|
|
|
nameCh: item.Name,
|
|
@@ -1515,6 +1612,9 @@ export const chartSetMixin = {
|
|
|
const { DataList,XName,XNameEn,YName,YNameEn } = 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,
|
|
@@ -1522,15 +1622,23 @@ export const chartSetMixin = {
|
|
|
text: YName,
|
|
|
textCh:YName,// 中文
|
|
|
textEn:YNameEn||YName,
|
|
|
- style:{},
|
|
|
- styleEn:{},
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
align: 'middle',
|
|
|
},
|
|
|
+ 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轴
|
|
@@ -1540,12 +1648,20 @@ export const chartSetMixin = {
|
|
|
text: XName,
|
|
|
textCh:XName,// 中文
|
|
|
textEn:XNameEn || XName,
|
|
|
- style:{},
|
|
|
- styleEn:{},
|
|
|
+ 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)
|
|
|
}
|
|
|
|
|
|
//数据列
|
|
@@ -1559,9 +1675,11 @@ export const chartSetMixin = {
|
|
|
nameCh: item.Name,
|
|
|
nameEn: item.NameEn||item.Name,
|
|
|
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({
|
|
@@ -1683,17 +1801,18 @@ export const chartSetMixin = {
|
|
|
this.rightIndex = -1;
|
|
|
this.rightTwoIndex = -1;
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ 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
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1709,7 +1828,15 @@ export const chartSetMixin = {
|
|
|
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),
|
|
@@ -1719,6 +1846,7 @@ export const chartSetMixin = {
|
|
|
|
|
|
let series_item = {
|
|
|
data: item.Value.map(_ =>[_.X,_.Y]),
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
type: 'spline',
|
|
|
yAxis: index,
|
|
|
name: item.Name,
|
|
@@ -1767,6 +1895,9 @@ export const chartSetMixin = {
|
|
|
this.rightIndex = -1;
|
|
|
this.rightTwoIndex = -1;
|
|
|
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
const { min,max,x_min,x_max } = this.chartLimit;
|
|
|
|
|
|
const { DataList,XName,YName,XNameEn,YNameEn } = this.crossVarietyChartData;
|
|
@@ -1779,6 +1910,14 @@ export const chartSetMixin = {
|
|
|
textCh:YName,// 中文
|
|
|
textEn:YNameEn||YName,
|
|
|
align: 'middle',
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labels: {
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
},
|
|
|
opposite: false,
|
|
|
reversed: false,
|
|
@@ -1795,6 +1934,14 @@ export const chartSetMixin = {
|
|
|
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),
|
|
@@ -2188,6 +2335,7 @@ export const chartSetMixin = {
|
|
|
sourceMap[this.chartInfo.Source]();
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
// 设置 起始日期 和 最新日期
|
|
|
setExtremumDate(){
|
|
|
//过滤、排序 拿到起始日期
|
|
@@ -2201,6 +2349,63 @@ export const chartSetMixin = {
|
|
|
.sort((a,b)=> new Date(b).getTime() - new Date(a).getTime())
|
|
|
this.latestDate = endDateList[0]
|
|
|
console.log(this.earliestDate,this.latestDate,'this.latestDate');
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 处理轴的标识线结构 在指定轴位置上拼接标识线
|
|
|
+ 0:右轴 1:左轴 2:右2轴 x轴固定3
|
|
|
+ axisType表示x轴类型 处理时间轴的值 datetime/null
|
|
|
+ */
|
|
|
+ setAxisPlotLines(axis,axisType=null) {
|
|
|
+ const { MarkersLines } = this.chartInfo;
|
|
|
+ if(!MarkersLines) return []
|
|
|
+ let arr = MarkersLines.filter(_ => _.isShow&&_.axis===axis)
|
|
|
+ let plotLines = arr.map(_ => {
|
|
|
+ //是否是x时间轴
|
|
|
+ let isXDateAxis = axis===3&&axisType==='datetime'
|
|
|
+ return {
|
|
|
+ value: isXDateAxis ? new Date(_.value).getTime() : Number(_.value),
|
|
|
+ dashStyle: _.dashStyle,
|
|
|
+ width: Number(_.lineWidth),
|
|
|
+ color: _.color,
|
|
|
+ label: {
|
|
|
+ text: _.text||'',
|
|
|
+ verticalAlign: _.textPosition,
|
|
|
+ style: {
|
|
|
+ color: _.textColor,
|
|
|
+ fontSize: _.textFontSize
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(plotLines)
|
|
|
+ return plotLines
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 处理标识区拼接 axisType表示x轴类型处理时间轴的值 datetime/null */
|
|
|
+ setAxisPlotAreas(axis,axisType=null) {
|
|
|
+ const { MarkersAreas } = this.chartInfo;
|
|
|
+ if(!MarkersAreas) return []
|
|
|
+
|
|
|
+ let arr = MarkersAreas.filter(_ => _.isShow&&_.axis===axis)
|
|
|
+ let plotBands = arr.map(_ => {
|
|
|
+ //是否是x时间轴
|
|
|
+ let isXDateAxis = axis===3&&axisType==='datetime'
|
|
|
+ return {
|
|
|
+ from: isXDateAxis ? new Date(_.fromValue).getTime() : Number(_.fromValue),
|
|
|
+ to: isXDateAxis ? new Date(_.toValue).getTime(): Number(_.toValue),
|
|
|
+ color: _.color,
|
|
|
+ label: {
|
|
|
+ text: _.text||'',
|
|
|
+ verticalAlign: _.textPosition,
|
|
|
+ style: {
|
|
|
+ color: _.textColor,
|
|
|
+ fontSize: _.textFontSize
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ return plotBands
|
|
|
}
|
|
|
}
|
|
|
}
|