|
@@ -1,7 +1,7 @@
|
|
|
// 图渲染逻辑模块
|
|
|
|
|
|
import {onMounted,ref,nextTick,reactive} from 'vue'
|
|
|
-import {chartDefaultOpts,scatterXAxis,basicYAxis,basicXAxis,leadUnitEnMap,relevanceUnitEnMap} from './config'
|
|
|
+import {chartDefaultOpts,scatterXAxis,basicYAxis,basicXAxis,leadUnitEnMap,relevanceUnitEnMap,seasonOptions} from './config'
|
|
|
import Highcharts from 'highcharts/highstock';
|
|
|
import HighchartsFormat from 'highcharts';
|
|
|
import HighchartsMore from 'highcharts/highcharts-more';
|
|
@@ -481,11 +481,11 @@ function setChartLang(changeLangIsCheck){
|
|
|
}
|
|
|
if([2,3,4].includes(Source)){
|
|
|
options.value.yAxis.forEach(item => {
|
|
|
- item.title.text = LangType.value == 'zh' ? item.title.textZh: item.title.textEn
|
|
|
+ item.title.text = LangType.value == 'zh' ? item.title.textZh: item.title.textEn||item.title.textZh
|
|
|
});
|
|
|
//图例
|
|
|
options.value.series.forEach(item => {
|
|
|
- item.name = LangType.value == 'en' ?item.nameEn : item.nameZh
|
|
|
+ item.name = LangType.value == 'en' ?(item.nameEn||item.nameZh) : item.nameZh
|
|
|
});
|
|
|
//tooltip
|
|
|
options.value.tooltip.formatter = LangType.value == 'en'?options.value.tooltip.formatterEn:options.value.tooltip.formatterZh
|
|
@@ -494,7 +494,7 @@ function setChartLang(changeLangIsCheck){
|
|
|
options.value.xAxis.categories = commodityXData.value.filter(_=>_.IsHide===0).map(_ => LangType.value == 'en'?_.NameEn:_.Name);
|
|
|
}
|
|
|
if([3].includes(Source)){
|
|
|
- options.value.xAxis.title.text=LangType.value == 'en'?options.value.xAxis.title.textEn:options.value.xAxis.title.textZh
|
|
|
+ options.value.xAxis.title.text=LangType.value == 'en'?(options.value.xAxis.title.textEn||options.value.xAxis.title.textZh):options.value.xAxis.title.textZh
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -559,17 +559,18 @@ function setStatisticFrequency(e){
|
|
|
max: index===0? Number(LeftMaxValue):Number(RightMaxValue),
|
|
|
tickWidth: 1,
|
|
|
}
|
|
|
-
|
|
|
+ //图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
|
let series_item = {
|
|
|
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,
|
|
|
name: item.Name,
|
|
|
nameZh: item.Name,
|
|
|
nameEn: item.NameEn||item.Name,
|
|
|
color: item.Color,
|
|
|
- lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth)||3,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth)||3,
|
|
|
chartType: 'linear',
|
|
|
zIndex:1
|
|
|
}
|
|
@@ -646,28 +647,29 @@ function setSplineOpt(e){
|
|
|
let temNameEN=setDyncmicSerieName(item,dynamic_arr,'en')
|
|
|
//预测指标配置
|
|
|
let predict_params = item.EdbInfoCategoryType === 1 ? getPredictParams(item) : {};
|
|
|
-
|
|
|
+ //图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
|
let seriesItemObj={
|
|
|
data:[],
|
|
|
dataGrouping:{
|
|
|
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,
|
|
|
name:temName,
|
|
|
nameZh:temName,
|
|
|
nameEn:temNameEN,
|
|
|
color: item.ChartColor,
|
|
|
- lineWidth: Number(item.ChartWidth)||(chartTheme&&chartTheme.lineOptionList[index].lineWidth)||1,
|
|
|
+ lineWidth: Number(item.ChartWidth)||(chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth)||1,
|
|
|
visible:true,
|
|
|
LatestDate:item.LatestDate,
|
|
|
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,
|
|
|
- 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
|
|
|
}
|
|
@@ -819,7 +821,8 @@ function setSplineOpt(e){
|
|
|
//季节图
|
|
|
function setSeasonOpt(e){
|
|
|
axisLimitState.leftIndex=0
|
|
|
- axisLimitState.rightIndex=-1
|
|
|
+ const {RightAxis:SeasonRightConfig={}} = e.DataResp||{}
|
|
|
+ axisLimitState.rightIndex=SeasonRightConfig.IsShow?1:-1
|
|
|
axisLimitState.rightTwoIndex=-1
|
|
|
|
|
|
/* 主题样式*/
|
|
@@ -832,33 +835,36 @@ function setSeasonOpt(e){
|
|
|
const colorsArr=chartTheme&&chartTheme.colorsOptions.reverse();
|
|
|
let series=[],yAxis=[]
|
|
|
//农历默认选中一年数据并隐藏按钮 公历显示全部数据
|
|
|
- // let rangeSelector={}
|
|
|
// 农历数据需要去除第一项 农历和公历处理逻辑一样
|
|
|
const chartDataHandle=calendarType === '农历'?
|
|
|
data.DataList.filter((item, index) => index > 0):
|
|
|
data.DataList
|
|
|
+ // 跟颜色对应
|
|
|
+ chartTheme && (chartTheme.lineOptionList=chartTheme.lineOptionList.reverse().slice(-chartDataHandle.length))
|
|
|
// if(calendarType==='公历'){
|
|
|
+ //常规左轴
|
|
|
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[index].lineType) || data.ChartStyle,
|
|
|
- dashStyle: (chartTheme&&chartTheme.lineOptionList[index].dashStyle)||'Solid',
|
|
|
+ type: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineType) || data.ChartStyle,
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptionList[lineIndex].dashStyle)||'Solid',
|
|
|
yAxis:0,
|
|
|
name:item.ChartLegend,
|
|
|
- lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth) || 1,
|
|
|
- color:colorsArr.slice(-chartDataHandle.length)[index],
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth) || 1,
|
|
|
+ // color:colorsArr.slice(-chartDataHandle.length)[lineIndex], //与PC端的配置不同步,导致两边 十条之后的线条颜色不对应
|
|
|
visible:true,
|
|
|
- marker:chartTheme && chartTheme.lineOptionList[index].dataMark && chartTheme.lineOptionList[index].dataMark!='none'?{
|
|
|
+ marker:chartTheme && chartTheme.lineOptionList[lineIndex].dataMark && chartTheme.lineOptionList[lineIndex].dataMark!='none'?{
|
|
|
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
|
|
|
}
|
|
@@ -868,16 +874,97 @@ function setSeasonOpt(e){
|
|
|
}
|
|
|
series.push(seriesItem)
|
|
|
})
|
|
|
-
|
|
|
+ chartData.colors = colorsArr.slice(-chartDataHandle.length)
|
|
|
+
|
|
|
+ //同期上下限/均线/标准差
|
|
|
+ const {MaxMinLimits={},SamePeriodAverage={},SamePeriodStandardDeviation={}} = e.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
|
|
|
+ }
|
|
|
+ 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'
|
|
|
+ }
|
|
|
+ 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||'')
|
|
|
+ }
|
|
|
+ SamePeriodStandardDeviation.List.forEach(item=>{
|
|
|
+ serieItem.data.push([item.DataTimestamp,item.MinValue,item.MaxValue])
|
|
|
+ })
|
|
|
+ series.push(serieItem)
|
|
|
+ }
|
|
|
+ //右轴
|
|
|
+ if(SeasonRightConfig.IsShow){
|
|
|
+ //右轴的设置
|
|
|
+ let serieConfig = SeasonRightConfig.Style==='column'?{
|
|
|
+ //柱形
|
|
|
+ type:'column',
|
|
|
+ color:SeasonRightConfig.ChartColor
|
|
|
+ }:{
|
|
|
+ //标记点
|
|
|
+ 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
|
|
|
+ },
|
|
|
+ }
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+
|
|
|
//获取上下限
|
|
|
- let minLimit = 0,maxLimit = 0
|
|
|
- //非ETA图库不使用自定义上下限
|
|
|
+ let minLimit = 0,maxLimit = 0,rightMin = 0,rightMax = 0
|
|
|
+ //非ETA图库不使用自定义上下限 非ETA图库的季节性图也不能设置右轴
|
|
|
if(!useSelfLimit){
|
|
|
minLimit = data.MinData
|
|
|
maxLimit = data.MaxData
|
|
|
}else{
|
|
|
minLimit = axisLimitState.leftMin||0
|
|
|
maxLimit = axisLimitState.leftMax||0
|
|
|
+ //右轴上下限设置
|
|
|
+ if(axisLimitState.rightIndex!==-1){
|
|
|
+ rightMin = axisLimitState.rightMin||0
|
|
|
+ rightMax = axisLimitState.rightMax||0
|
|
|
+ }
|
|
|
}
|
|
|
const textZh = data.ConvertUnit||data.Unit
|
|
|
const textEn = data.ConvertEnUnit||data.UnitEn||data.ConvertUnit||data.Unit
|
|
@@ -926,7 +1013,41 @@ function setSeasonOpt(e){
|
|
|
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: {
|
|
|
+ align: 'center',
|
|
|
+ y:5,
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ text: rightEdb.Unit||'',
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
+ align: 'high',
|
|
|
+ rotation: 0,
|
|
|
+ y: -5,
|
|
|
+ x: 0,
|
|
|
+ textAlign: 'right',
|
|
|
+ reserveSpace: false,
|
|
|
+ },
|
|
|
+ max: Number(rightMax),
|
|
|
+ min: Number(rightMin),
|
|
|
+ })
|
|
|
+ }
|
|
|
chartData.series=series
|
|
|
chartData.yAxis=yAxis
|
|
|
// chartData.rangeSelector=rangeSelector
|
|
@@ -1070,7 +1191,8 @@ function setStackOrCombinChart(e){
|
|
|
|
|
|
//预测指标配置
|
|
|
let predict_params = item.EdbInfoCategoryType === 1 ? getPredictParams(item) : {};
|
|
|
-
|
|
|
+ //图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
|
let seriesItemObj={
|
|
|
data:[],
|
|
|
dataGrouping:{
|
|
@@ -1082,7 +1204,7 @@ function setStackOrCombinChart(e){
|
|
|
nameZh:temName,
|
|
|
nameEn:temNameEN,
|
|
|
color: item.ChartColor,
|
|
|
- lineWidth: Number(item.ChartWidth),
|
|
|
+ lineWidth: Number(item.ChartWidth)||(chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth) || 1,
|
|
|
fillColor: (e.ChartInfo.ChartType === 3 || (e.ChartInfo.ChartType === 6 && item.ChartStyle === 'areaspline')) ? item.ChartColor : undefined,
|
|
|
visible:true,
|
|
|
LatestDate:item.LatestDate,
|
|
@@ -1604,18 +1726,19 @@ const setCommodityChart = (leftMin,leftMax) => {
|
|
|
data.forEach((item,index) => {
|
|
|
//处理首或/尾全是无效数据的以null填充
|
|
|
let filterData = filterInvalidData(item)
|
|
|
-
|
|
|
+ //图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
|
let serie_item = {
|
|
|
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,
|
|
|
name: item.Name,
|
|
|
nameZh: item.Name,
|
|
|
nameEn: item.NameEn,
|
|
|
color: item.Color,
|
|
|
chartType: 'linear',
|
|
|
- lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth) || 3,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth) || 3,
|
|
|
visible: true,
|
|
|
marker: {
|
|
|
enabled: false
|
|
@@ -1830,17 +1953,19 @@ function initRelevanceChart(data){
|
|
|
//处理series
|
|
|
let seriesData=[]
|
|
|
data.YDataList.forEach((item,index)=>{
|
|
|
+ //图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
|
let serie_item = {
|
|
|
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,
|
|
|
- name: data.ChartInfo.ChartName,
|
|
|
- nameZh: data.ChartInfo.ChartName,
|
|
|
- nameEn: data.ChartInfo.ChartNameEn,
|
|
|
+ name: item.Name||data.ChartInfo.ChartName,
|
|
|
+ nameZh: item.Name||data.ChartInfo.ChartName,
|
|
|
+ nameEn: item.NameEn||data.ChartInfo.ChartNameEn,
|
|
|
color: item.Color,
|
|
|
chartType: 'linear',
|
|
|
- lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth) || 3,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth) || 3,
|
|
|
visible:true,
|
|
|
marker: {
|
|
|
enabled: false
|
|
@@ -1973,6 +2098,8 @@ function setSectionScatterChart({DataResp,ChartInfo}) {
|
|
|
//数据列
|
|
|
let series = [];
|
|
|
DataList.forEach((item,index) => {
|
|
|
+ //图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
|
//数据列
|
|
|
let series_item = {
|
|
|
data: [],
|
|
@@ -1986,7 +2113,7 @@ function setSectionScatterChart({DataResp,ChartInfo}) {
|
|
|
zIndex:1,
|
|
|
visible: true,
|
|
|
marker: {
|
|
|
- radius: (chartTheme&&chartTheme.lineOptionList[index].radius)||5,
|
|
|
+ radius: (chartTheme&&chartTheme.lineOptionList[lineIndex].radius)||5,
|
|
|
},
|
|
|
}
|
|
|
item.EdbInfoList.forEach(_ => {
|
|
@@ -2314,17 +2441,19 @@ function setRadarChart({DataResp,EdbInfoList,ChartInfo}) {
|
|
|
//系列
|
|
|
let series = [];
|
|
|
YDataList.forEach((item,index) => {
|
|
|
+ //图表可配置的线条数就10条,第11条用第1条的配置,索引取下模
|
|
|
+ const lineIndex = chartTheme ? index%chartTheme.lineOptionList.length : index
|
|
|
let serie_item = {
|
|
|
name: item.Name || item.Date,
|
|
|
nameZh: item.Name || item.Date,
|
|
|
nameEn: item.Date,
|
|
|
data: item.Value,
|
|
|
pointPlacement: 'on',
|
|
|
- type: (chartTheme&&chartTheme.lineOptionList[index].lineType) || 'line',
|
|
|
- dashStyle: (chartTheme&&chartTheme.lineOptionList[index].dashStyle)||'Solid',
|
|
|
+ type: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineType) || 'line',
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptionList[lineIndex].dashStyle)||'Solid',
|
|
|
yAxis: 0,
|
|
|
color: item.Color,
|
|
|
- lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth) || 1,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth) || 1,
|
|
|
chartType: 'linear'
|
|
|
};
|
|
|
series.push(serie_item)
|
|
@@ -2349,9 +2478,15 @@ function setRadarChart({DataResp,EdbInfoList,ChartInfo}) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+//获取RGBA的透明度
|
|
|
+function parseRgbaColor(color='rgba(51, 51, 51, 1)'){
|
|
|
+ const arr = color.match(/(\d(\.\d+)?)+/g) || ['','','',1];
|
|
|
+ return parseFloat(arr[3]||1)
|
|
|
+}
|
|
|
/* ----自定义上下限相关--- */
|
|
|
/* 计算y轴上下限 */
|
|
|
-function calcYAxislimit(tableData=[],ChartInfo){
|
|
|
+function calcYAxislimit(tableData=[],ChartInfo,DataResp={}){
|
|
|
//散点图单独处理
|
|
|
if(ChartInfo.ChartType===5){
|
|
|
if(tableData[1]){
|
|
@@ -2389,6 +2524,19 @@ function calcYAxislimit(tableData=[],ChartInfo){
|
|
|
axisLimitState.rightTwoMin = Min
|
|
|
axisLimitState.rightTwoMax = Max
|
|
|
}
|
|
|
+ //季节性图-右轴单独处理
|
|
|
+ if(ChartInfo.ChartType===2){
|
|
|
+ if(DataResp.RightAxis&&DataResp.RightAxis.IsAdd&&DataResp.RightAxis.IsShow){
|
|
|
+ if(DataResp.RightAxis.IndicatorType===1){
|
|
|
+ axisLimitState.rightMin = DataResp.RightAxis.EdbInfoList[0].MinData||0
|
|
|
+ axisLimitState.rightMax = DataResp.RightAxis.EdbInfoList[0].MaxData||0
|
|
|
+ }else{
|
|
|
+ axisLimitState.rightMin = tableData[1].MinData||0
|
|
|
+ axisLimitState.rightMax = tableData[1].MaxData||0
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
function calcLimit(arr) {
|
|
|
return {
|
|
@@ -2397,7 +2545,7 @@ function calcLimit(arr) {
|
|
|
}
|
|
|
}
|
|
|
//图表详情-设置图表上下限
|
|
|
-function setLimitData({EdbInfoList,ChartInfo}){
|
|
|
+function setLimitData({EdbInfoList,ChartInfo,DataResp}){
|
|
|
const {
|
|
|
//左右轴极值字段
|
|
|
LeftMin=0,LeftMax=0,
|
|
@@ -2416,7 +2564,7 @@ function setLimitData({EdbInfoList,ChartInfo}){
|
|
|
checkLimit(EdbInfoList,ChartInfo)
|
|
|
console.log('check',axisLimitState.leftMin,axisLimitState.leftMax)
|
|
|
}else{
|
|
|
- calcYAxislimit(EdbInfoList,ChartInfo)
|
|
|
+ calcYAxislimit(EdbInfoList,ChartInfo,DataResp?DataResp:{})
|
|
|
}
|
|
|
}
|
|
|
function checkLimit(tableData=[],ChartInfo){
|