|
@@ -71,6 +71,28 @@ const basicXAxis={
|
|
},
|
|
},
|
|
xDateFormat:'%Y-%m-%d'
|
|
xDateFormat:'%Y-%m-%d'
|
|
}
|
|
}
|
|
|
|
+//季节性图设置
|
|
|
|
+const seasonOptions = {
|
|
|
|
+ //默认颜色配置
|
|
|
|
+ colors:['#4B0082','#7FFFAA','#FF4500','#808000','#EEE8AA','#849EC1','#8A4294','#578B5A','#FDA8C7','#53B3FF','#999999','#000000','#FFDF0C','#FF0000','#0033FF'],
|
|
|
|
+ yAxis: {
|
|
|
|
+ lineWidth: 1,
|
|
|
|
+ lineColor: '#bfbfbf',
|
|
|
|
+ tickColor: '#bfbfbf',
|
|
|
|
+ offset: 0,
|
|
|
|
+ opposite: false,
|
|
|
|
+ reversed: false,
|
|
|
|
+ visible: true,
|
|
|
|
+ gridLineWidth: 0,
|
|
|
|
+ tickWidth: 1,
|
|
|
|
+ tickLength:5,
|
|
|
|
+ tickPosition: 'inside',
|
|
|
|
+ endOnTick: false,
|
|
|
|
+ startOnTick: false,
|
|
|
|
+ showLastLabel: true, //显示最后刻度值
|
|
|
|
+ tickPixelInterval: 50
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
@@ -521,17 +543,19 @@ const initRelevanceChart=(data)=>{
|
|
//处理series
|
|
//处理series
|
|
let seriesData=[]
|
|
let seriesData=[]
|
|
data.YDataList.forEach((item,index)=>{
|
|
data.YDataList.forEach((item,index)=>{
|
|
|
|
+ // 图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
let serie_item = {
|
|
let serie_item = {
|
|
data: item.Value,
|
|
data: item.Value,
|
|
- type: (chartTheme&&chartTheme.lineOptionList[index].lineType) || 'spline',
|
|
|
|
- dashStyle: (chartTheme&&chartTheme.lineOptionList[index].dashStyle)||'Solid',
|
|
|
|
|
|
+ type: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineType) || 'spline',
|
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptionList[lineIndex].dashStyle)||'Solid',
|
|
yAxis: 0,
|
|
yAxis: 0,
|
|
- name: data.ChartInfo.ChartName,
|
|
|
|
- nameCh: data.ChartInfo.ChartName,
|
|
|
|
- nameEn: data.ChartInfo.ChartName,
|
|
|
|
- color: '#00f',
|
|
|
|
|
|
+ name: item.Name||data.ChartInfo.ChartName,
|
|
|
|
+ nameCh: item.Name||data.ChartInfo.ChartName,
|
|
|
|
+ nameEn: item.NameEn||data.ChartInfo.ChartName,
|
|
|
|
+ color: item.Color||'#00f',
|
|
chartType: 'linear',
|
|
chartType: 'linear',
|
|
- lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth) || 3,
|
|
|
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth) || 3,
|
|
visible:true,
|
|
visible:true,
|
|
marker: {
|
|
marker: {
|
|
enabled: false
|
|
enabled: false
|
|
@@ -752,16 +776,17 @@ const setCommodityChart = () => {
|
|
data.forEach((item,index) => {
|
|
data.forEach((item,index) => {
|
|
//处理首或/尾全是无效数据的以null填充
|
|
//处理首或/尾全是无效数据的以null填充
|
|
let filterData = filterInvalidData(item)
|
|
let filterData = filterInvalidData(item)
|
|
-
|
|
|
|
|
|
+ // 图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
let serie_item = {
|
|
let serie_item = {
|
|
data: filterData,
|
|
data: filterData,
|
|
- type: (chartTheme&&chartTheme.lineOptionList[index].lineType) || 'spline',
|
|
|
|
- dashStyle: (chartTheme&&chartTheme.lineOptionList[index].dashStyle)||'Solid',
|
|
|
|
|
|
+ type: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineType) || 'spline',
|
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptionList[lineIndex].dashStyle)||'Solid',
|
|
yAxis: 0,
|
|
yAxis: 0,
|
|
name: item.Name,
|
|
name: item.Name,
|
|
color: item.Color,
|
|
color: item.Color,
|
|
chartType: 'linear',
|
|
chartType: 'linear',
|
|
- lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth) || 3,
|
|
|
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth) || 3,
|
|
visible: true,
|
|
visible: true,
|
|
marker: {
|
|
marker: {
|
|
enabled: false
|
|
enabled: false
|
|
@@ -911,6 +936,8 @@ const setSectionScatterChart = () => {
|
|
//数据列
|
|
//数据列
|
|
let series = [];
|
|
let series = [];
|
|
DataList.forEach((item,index) => {
|
|
DataList.forEach((item,index) => {
|
|
|
|
+ // 图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
//数据列
|
|
//数据列
|
|
let series_item = {
|
|
let series_item = {
|
|
data: [],
|
|
data: [],
|
|
@@ -921,7 +948,7 @@ const setSectionScatterChart = () => {
|
|
chartType: 'linear',
|
|
chartType: 'linear',
|
|
zIndex:1,
|
|
zIndex:1,
|
|
marker: {
|
|
marker: {
|
|
- radius: (chartTheme&&chartTheme.lineOptionList[index].radius)||5,
|
|
|
|
|
|
+ radius: (chartTheme&&chartTheme.lineOptionList[lineIndex].radius)||5,
|
|
},
|
|
},
|
|
visible: true
|
|
visible: true
|
|
}
|
|
}
|
|
@@ -1061,15 +1088,16 @@ const setStatisticFrequency = () => {
|
|
max: index===0? Number(LeftMaxValue):Number(RightMaxValue),
|
|
max: index===0? Number(LeftMaxValue):Number(RightMaxValue),
|
|
tickWidth: 1,
|
|
tickWidth: 1,
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // 图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
let series_item = {
|
|
let series_item = {
|
|
data: item.Value.map(_ =>[_.X,_.Y]),
|
|
data: item.Value.map(_ =>[_.X,_.Y]),
|
|
- dashStyle: (chartTheme&&chartTheme.lineOptionList[index].dashStyle)||'Solid',
|
|
|
|
- type: (chartTheme&&chartTheme.lineOptionList[index].lineType) || 'spline',
|
|
|
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptionList[lineIndex].dashStyle)||'Solid',
|
|
|
|
+ type: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineType) || 'spline',
|
|
yAxis: index,
|
|
yAxis: index,
|
|
name: item.Name,
|
|
name: item.Name,
|
|
color: item.Color,
|
|
color: item.Color,
|
|
- lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth)||3,
|
|
|
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth)||3,
|
|
chartType: 'linear',
|
|
chartType: 'linear',
|
|
visible: true,
|
|
visible: true,
|
|
zIndex:1
|
|
zIndex:1
|
|
@@ -1311,19 +1339,21 @@ const setRadarChart = () => {
|
|
//系列
|
|
//系列
|
|
let series = [];
|
|
let series = [];
|
|
YDataList.forEach((item,index) => {
|
|
YDataList.forEach((item,index) => {
|
|
- let serie_item = {
|
|
|
|
- data: item.Value,
|
|
|
|
- pointPlacement: 'on',
|
|
|
|
- type: (chartTheme&&chartTheme.lineOptionList[index].lineType) || 'line',
|
|
|
|
- dashStyle: (chartTheme&&chartTheme.lineOptionList[index].dashStyle)||'Solid',
|
|
|
|
- yAxis: 0,
|
|
|
|
- name: item.Name || item.Date,
|
|
|
|
- color: item.Color,
|
|
|
|
- lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth) || 1,
|
|
|
|
- chartType: 'linear',
|
|
|
|
- visible: true
|
|
|
|
- };
|
|
|
|
- series.push(serie_item)
|
|
|
|
|
|
+ // 图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
|
|
+ let serie_item = {
|
|
|
|
+ data: item.Value,
|
|
|
|
+ pointPlacement: 'on',
|
|
|
|
+ type: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineType) || 'line',
|
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptionList[lineIndex].dashStyle)||'Solid',
|
|
|
|
+ yAxis: 0,
|
|
|
|
+ name: item.Name || item.Date,
|
|
|
|
+ color: item.Color,
|
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth) || 1,
|
|
|
|
+ chartType: 'linear',
|
|
|
|
+ visible: true
|
|
|
|
+ };
|
|
|
|
+ series.push(serie_item)
|
|
})
|
|
})
|
|
|
|
|
|
chartData.value = {
|
|
chartData.value = {
|
|
@@ -1421,26 +1451,27 @@ const setSplineOpt=(data)=>{
|
|
|
|
|
|
//预测指标配置
|
|
//预测指标配置
|
|
let predict_params = item.EdbInfoCategoryType === 1 ? getPredictParams(item) : {};
|
|
let predict_params = item.EdbInfoCategoryType === 1 ? getPredictParams(item) : {};
|
|
-
|
|
|
|
|
|
+ // 图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
let seriesItemObj={
|
|
let seriesItemObj={
|
|
data:[],
|
|
data:[],
|
|
dataGrouping:{
|
|
dataGrouping:{
|
|
enabled:false
|
|
enabled:false
|
|
},
|
|
},
|
|
- type: (chartTheme&&chartTheme.lineOptionList[index].lineType) || 'spline',
|
|
|
|
- dashStyle: (chartTheme&&chartTheme.lineOptionList[index].dashStyle)||'Solid',
|
|
|
|
|
|
+ type: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineType) || 'spline',
|
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptionList[lineIndex].dashStyle)||'Solid',
|
|
yAxis:index,
|
|
yAxis:index,
|
|
name:temName,
|
|
name:temName,
|
|
color: item.ChartColor,
|
|
color: item.ChartColor,
|
|
- lineWidth: Number(item.ChartWidth),
|
|
|
|
|
|
+ lineWidth: Number(item.ChartWidth)|| (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth)||1,
|
|
visible:true,
|
|
visible:true,
|
|
LatestDate:item.LatestDate,
|
|
LatestDate:item.LatestDate,
|
|
LatestValue:item.LatestValue,
|
|
LatestValue:item.LatestValue,
|
|
- marker: chartTheme && chartTheme.lineOptionList[index].dataMark && chartTheme.lineOptionList[index].dataMark!='none'?{
|
|
|
|
|
|
+ marker: chartTheme && chartTheme.lineOptionList[lineIndex].dataMark && chartTheme.lineOptionList[lineIndex].dataMark!='none'?{
|
|
enabled:true,
|
|
enabled:true,
|
|
- symbol: chartTheme.lineOptionList[index].markType || 'circle',
|
|
|
|
- fillColor:chartTheme.lineOptionList[index].markColor,
|
|
|
|
- radius: chartTheme.lineOptionList[index].markSize
|
|
|
|
|
|
+ symbol: chartTheme.lineOptionList[lineIndex].markType || 'circle',
|
|
|
|
+ fillColor:chartTheme.lineOptionList[lineIndex].markColor,
|
|
|
|
+ radius: chartTheme.lineOptionList[lineIndex].markSize
|
|
}:{},
|
|
}:{},
|
|
...predict_params
|
|
...predict_params
|
|
}
|
|
}
|
|
@@ -1832,6 +1863,11 @@ const changeEdbOrder = (data) => {
|
|
return [left_edbs,right_edbs,right_two_edbs].flat(Infinity);
|
|
return [left_edbs,right_edbs,right_two_edbs].flat(Infinity);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//获取RGBA的透明度
|
|
|
|
+function parseRgbaColor(color='rgba(51, 51, 51, 1)'){
|
|
|
|
+ const arr = color.match(/(\d(\.\d+)?)+/g) || ['','','',1];
|
|
|
|
+ return parseFloat(arr[3]||1)
|
|
|
|
+}
|
|
//设置季节图配置
|
|
//设置季节图配置
|
|
const setSeasonOpt=(data)=>{
|
|
const setSeasonOpt=(data)=>{
|
|
hasLeftAxis.value=true
|
|
hasLeftAxis.value=true
|
|
@@ -1840,6 +1876,7 @@ const setSeasonOpt=(data)=>{
|
|
const chartTheme = resData.value.ChartInfo.ChartThemeStyle ? JSON.parse(resData.value.ChartInfo.ChartThemeStyle) : null;
|
|
const chartTheme = resData.value.ChartInfo.ChartThemeStyle ? JSON.parse(resData.value.ChartInfo.ChartThemeStyle) : null;
|
|
|
|
|
|
const colorsArr=chartTheme&&chartTheme.colorsOptions.reverse();
|
|
const colorsArr=chartTheme&&chartTheme.colorsOptions.reverse();
|
|
|
|
+
|
|
let series=[],yAxis=[]
|
|
let series=[],yAxis=[]
|
|
//农历默认选中一年数据并隐藏按钮 公历显示全部数据
|
|
//农历默认选中一年数据并隐藏按钮 公历显示全部数据
|
|
// let rangeSelector={}
|
|
// let rangeSelector={}
|
|
@@ -1851,82 +1888,203 @@ const setSeasonOpt=(data)=>{
|
|
data.DataList.slice(1,data.DataList.length)||[]:
|
|
data.DataList.slice(1,data.DataList.length)||[]:
|
|
data.DataList
|
|
data.DataList
|
|
|
|
|
|
- chartDataHandle.forEach((item,index)=>{
|
|
|
|
- //预测指标配置
|
|
|
|
- let predict_params = data.EdbInfoCategoryType === 1 ? getSeasonPredictParams(item.CuttingDataTimestamp) : {};
|
|
|
|
-
|
|
|
|
- let seriesItem={
|
|
|
|
- data:[],
|
|
|
|
- dataGrouping:{
|
|
|
|
- enabled:false
|
|
|
|
- },
|
|
|
|
- type: (chartTheme&&chartTheme.lineOptionList[index].lineType) || data.ChartStyle,
|
|
|
|
- dashStyle: (chartTheme&&chartTheme.lineOptionList[index].dashStyle)||'Solid',
|
|
|
|
- yAxis:0,
|
|
|
|
- name:item.ChartLegend,
|
|
|
|
- color:colorsArr.slice(-chartDataHandle.length)[index],
|
|
|
|
- visible:true,
|
|
|
|
- marker: chartTheme && chartTheme.lineOptionList[index].dataMark && chartTheme.lineOptionList[index].dataMark!='none'?{
|
|
|
|
- enabled:true,
|
|
|
|
- symbol: chartTheme.lineOptionList[index].markType || 'circle',
|
|
|
|
- fillColor:chartTheme.lineOptionList[index].markColor,
|
|
|
|
- radius: chartTheme.lineOptionList[index].markSize
|
|
|
|
- }:{},
|
|
|
|
- ...predict_params
|
|
|
|
- }
|
|
|
|
- item.DataList=item.DataList||[]
|
|
|
|
- for(let i of item.DataList){
|
|
|
|
- seriesItem.data.push([i.DataTimestamp, i.Value])
|
|
|
|
- }
|
|
|
|
- series.push(seriesItem)
|
|
|
|
|
|
+ // 跟颜色对应
|
|
|
|
+ chartTheme && (chartTheme.lineOptionList=chartTheme.lineOptionList.reverse().slice(-chartDataHandle.length))
|
|
|
|
+ //常规左轴
|
|
|
|
+ chartDataHandle.forEach((item,index)=>{
|
|
|
|
+ //预测指标配置
|
|
|
|
+ let predict_params = data.EdbInfoCategoryType === 1 ? getSeasonPredictParams(item.CuttingDataTimestamp) : {};
|
|
|
|
+ // 图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
|
|
+ let seriesItem={
|
|
|
|
+ data:[],
|
|
|
|
+ dataGrouping:{
|
|
|
|
+ enabled:false
|
|
|
|
+ },
|
|
|
|
+ type: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineType) || data.ChartStyle,
|
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptionList[lineIndex].dashStyle)||'Solid',
|
|
|
|
+ yAxis:0,
|
|
|
|
+ name:item.ChartLegend,
|
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth) || 1,
|
|
|
|
+ color:colorsArr.slice(-chartDataHandle.length)[lineIndex],
|
|
|
|
+ visible:true,
|
|
|
|
+ marker: chartTheme && chartTheme.lineOptionList[lineIndex].dataMark && chartTheme.lineOptionList[lineIndex].dataMark!='none'?{
|
|
|
|
+ enabled:true,
|
|
|
|
+ symbol: chartTheme.lineOptionList[lineIndex].markType || 'circle',
|
|
|
|
+ fillColor:chartTheme.lineOptionList[lineIndex].markColor,
|
|
|
|
+ radius: chartTheme.lineOptionList[lineIndex].markSize
|
|
|
|
+ }:{},
|
|
|
|
+ ...predict_params
|
|
|
|
+ }
|
|
|
|
+ item.DataList=item.DataList||[]
|
|
|
|
+ for(let i of item.DataList){
|
|
|
|
+ seriesItem.data.push([i.DataTimestamp, i.Value])
|
|
|
|
+ }
|
|
|
|
+ series.push(seriesItem)
|
|
|
|
|
|
|
|
+ })
|
|
|
|
+ //同期上下限/均线/标准差
|
|
|
|
+ const {MaxMinLimits={},SamePeriodAverage={},SamePeriodStandardDeviation={}} = resData.value.DataResp||{}
|
|
|
|
+ if(MaxMinLimits.IsShow&&MaxMinLimits.List&&MaxMinLimits.List.length){
|
|
|
|
+ let serieItem = {
|
|
|
|
+ type:'arearange',//上下限是一个范围
|
|
|
|
+ data:[],
|
|
|
|
+ name:MaxMinLimits.Legend||'同期上下限',
|
|
|
|
+ color:MaxMinLimits.Color||'#075EEE' ,
|
|
|
|
+ fillOpacity:parseRgbaColor(MaxMinLimits.Color||'')>0.75?0.75:parseRgbaColor(MaxMinLimits.Color||''), //透明度最高0.75
|
|
|
|
+ visible:true,
|
|
|
|
+ }
|
|
|
|
+ MaxMinLimits.List.forEach(item=>{
|
|
|
|
+ serieItem.data.push([item.DataTimestamp,item.MinValue,item.MaxValue])
|
|
|
|
+ })
|
|
|
|
+ series.push(serieItem)
|
|
|
|
+ }
|
|
|
|
+ if(SamePeriodAverage.IsShow&&SamePeriodAverage.List){
|
|
|
|
+ let serieItem = {
|
|
|
|
+ type:'line',
|
|
|
|
+ data:[],
|
|
|
|
+ lineWidth:SamePeriodAverage.LineWidth,
|
|
|
|
+ dashStyle:SamePeriodAverage.LineType,
|
|
|
|
+ name:SamePeriodAverage.Legend||'同期均值',
|
|
|
|
+ color:SamePeriodAverage.Color||'#075EEE',
|
|
|
|
+ visible:true,
|
|
|
|
+ }
|
|
|
|
+ SamePeriodAverage.List.forEach(item=>{
|
|
|
|
+ serieItem.data.push([item.DataTimestamp,item.Value])
|
|
|
|
+ })
|
|
|
|
+ series.push(serieItem)
|
|
|
|
+ }
|
|
|
|
+ if(SamePeriodStandardDeviation.IsShow&&SamePeriodStandardDeviation.List){
|
|
|
|
+ let serieItem = {
|
|
|
|
+ type:'arearange',//标准差也是一个范围
|
|
|
|
+ data:[],
|
|
|
|
+ name:SamePeriodStandardDeviation.Legend||'同期标准差',
|
|
|
|
+ color:SamePeriodStandardDeviation.Color||'#075EEE',
|
|
|
|
+ fillOpacity:parseRgbaColor(SamePeriodStandardDeviation.Color||'')>0.75?0.75:parseRgbaColor(SamePeriodStandardDeviation.Color||''),
|
|
|
|
+ visible:true,
|
|
|
|
+ }
|
|
|
|
+ SamePeriodStandardDeviation.List.forEach(item=>{
|
|
|
|
+ serieItem.data.push([item.DataTimestamp,item.MinValue,item.MaxValue])
|
|
})
|
|
})
|
|
|
|
+ series.push(serieItem)
|
|
|
|
+ }
|
|
|
|
+ //右轴
|
|
|
|
+ const {RightAxis:SeasonRightConfig={}} = resData.value.DataResp||{}
|
|
|
|
+ if(SeasonRightConfig.IsShow){
|
|
|
|
+ //右轴的设置
|
|
|
|
+ let serieConfig = SeasonRightConfig.Style==='column'?{
|
|
|
|
+ //柱形
|
|
|
|
+ type:'column',
|
|
|
|
+ color:SeasonRightConfig.ChartColor,
|
|
|
|
+ visible:true,
|
|
|
|
+ }:{
|
|
|
|
+ //标记点
|
|
|
|
+ type:'spline',
|
|
|
|
+ lineWidth:SeasonRightConfig.LineWidth,
|
|
|
|
+ dashStyle:SeasonRightConfig.LineStyle,
|
|
|
|
+ color:SeasonRightConfig.IsConnected?SeasonRightConfig.LineColor:'rgba(255, 255, 255, 0)',//没有连线颜色设置为透明
|
|
|
|
+ marker:{
|
|
|
|
+ enabled:true,
|
|
|
|
+ symbol:SeasonRightConfig.Shape,
|
|
|
|
+ fillColor:SeasonRightConfig.ChartColor,
|
|
|
|
+ radius:SeasonRightConfig.Size
|
|
|
|
+ },
|
|
|
|
+ visible:true,
|
|
|
|
+ }
|
|
|
|
+ let serieItem = {
|
|
|
|
+ ...serieConfig,
|
|
|
|
+ name:SeasonRightConfig.Legend||'',
|
|
|
|
+ data:[],
|
|
|
|
+ yAxis:1,
|
|
|
|
+ }
|
|
|
|
+ const DataList = (SeasonRightConfig.IndicatorType===1?SeasonRightConfig.EdbInfoList[0].DataList:e.EdbInfoList[1]?.DataList)||[]
|
|
|
|
+ DataList.forEach(item=>{
|
|
|
|
+ serieItem.data.push([item.DataTimestamp,item.Value])
|
|
|
|
+ })
|
|
|
|
+ series.push(serieItem)
|
|
|
|
+ }
|
|
|
|
|
|
- yAxis=[{
|
|
|
|
- IsAxis:data.IsAxis,
|
|
|
|
|
|
+ yAxis=[{
|
|
|
|
+ IsAxis:data.IsAxis,
|
|
|
|
+ labels: {
|
|
|
|
+ // formatter: function (ctx) {
|
|
|
|
+ // return ctx.value;
|
|
|
|
+ // },
|
|
|
|
+ align: 'center',
|
|
|
|
+ y:5,
|
|
|
|
+ style: {
|
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ title: {
|
|
|
|
+ text: `${data.Unit}`,
|
|
|
|
+ align: 'high',
|
|
|
|
+ rotation: 0,
|
|
|
|
+ y: -15,
|
|
|
|
+ x: 0,
|
|
|
|
+ textAlign: 'left',
|
|
|
|
+ reserveSpace: false,
|
|
|
|
+ style:{
|
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ max: Number(data.MaxData),
|
|
|
|
+ min: Number(data.MinData),
|
|
|
|
+ plotBands: setAxisPlotAreas(1),
|
|
|
|
+ plotLines: setAxisPlotLines(1),
|
|
|
|
+ lineWidth: 1,
|
|
|
|
+ lineColor: '#bfbfbf',
|
|
|
|
+ tickColor: '#bfbfbf',
|
|
|
|
+ offset: 0,
|
|
|
|
+ opposite: false,
|
|
|
|
+ reversed: false,
|
|
|
|
+ visible: true,
|
|
|
|
+ gridLineWidth: 0,
|
|
|
|
+ tickWidth: 1,
|
|
|
|
+ tickLength:5,
|
|
|
|
+ tickPosition: 'inside',
|
|
|
|
+ endOnTick: false,
|
|
|
|
+ startOnTick: false,
|
|
|
|
+ showLastLabel: true, //显示最后刻度值
|
|
|
|
+ tickPixelInterval: 50,
|
|
|
|
+ // chartEdbInfo:item//指标数据
|
|
|
|
+ }]
|
|
|
|
+
|
|
|
|
+ //如果有右轴,yAxis加上右轴
|
|
|
|
+ if(SeasonRightConfig.IsShow){
|
|
|
|
+ const rightEdb = (SeasonRightConfig.IndicatorType===1?SeasonRightConfig.EdbInfoList[0]:e.EdbInfoList[1])||{Unit:''}
|
|
|
|
+ //左轴同比:text为空或% 右轴指标:取指标单位
|
|
|
|
+ if(SeasonRightConfig.IndicatorType===1){
|
|
|
|
+ rightEdb.Unit = SeasonRightConfig.NumFormat===1?'%':''
|
|
|
|
+ }else{
|
|
|
|
+ rightEdb.Unit = e.EdbInfoList[1]&&(e.EdbInfoList[1].ConvertUnit||e.EdbInfoList[1].Unit)||''
|
|
|
|
+ }
|
|
|
|
+ yAxis.push({
|
|
|
|
+ ...seasonOptions.yAxis,
|
|
|
|
+ opposite: true,//右轴
|
|
labels: {
|
|
labels: {
|
|
- // formatter: function (ctx) {
|
|
|
|
- // return ctx.value;
|
|
|
|
- // },
|
|
|
|
align: 'center',
|
|
align: 'center',
|
|
y:5,
|
|
y:5,
|
|
style: {
|
|
style: {
|
|
- ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
}
|
|
}
|
|
- },
|
|
|
|
- title: {
|
|
|
|
- text: `${data.Unit}`,
|
|
|
|
|
|
+ },
|
|
|
|
+ title: {
|
|
|
|
+ text: rightEdb.Unit||'',
|
|
|
|
+ style:{
|
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
|
+ },
|
|
align: 'high',
|
|
align: 'high',
|
|
rotation: 0,
|
|
rotation: 0,
|
|
- y: -15,
|
|
|
|
|
|
+ y: -5,
|
|
x: 0,
|
|
x: 0,
|
|
- textAlign: 'left',
|
|
|
|
|
|
+ textAlign: 'right',
|
|
reserveSpace: false,
|
|
reserveSpace: false,
|
|
- style:{
|
|
|
|
- ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- max: Number(data.MaxData),
|
|
|
|
- min: Number(data.MinData),
|
|
|
|
- plotBands: setAxisPlotAreas(1),
|
|
|
|
- plotLines: setAxisPlotLines(1),
|
|
|
|
- lineWidth: 1,
|
|
|
|
- lineColor: '#bfbfbf',
|
|
|
|
- tickColor: '#bfbfbf',
|
|
|
|
- offset: 0,
|
|
|
|
- opposite: false,
|
|
|
|
- reversed: false,
|
|
|
|
- visible: true,
|
|
|
|
- gridLineWidth: 0,
|
|
|
|
- tickWidth: 1,
|
|
|
|
- tickLength:5,
|
|
|
|
- tickPosition: 'inside',
|
|
|
|
- endOnTick: false,
|
|
|
|
- startOnTick: false,
|
|
|
|
- showLastLabel: true, //显示最后刻度值
|
|
|
|
- tickPixelInterval: 50,
|
|
|
|
- // chartEdbInfo:item//指标数据
|
|
|
|
- }]
|
|
|
|
|
|
+ },
|
|
|
|
+ max: Number(rightEdb.MaxData||''),
|
|
|
|
+ min: Number(rightEdb.MinData||''),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
chartData.value.series=series
|
|
chartData.value.series=series
|
|
chartData.value.yAxis=yAxis
|
|
chartData.value.yAxis=yAxis
|