|
@@ -492,9 +492,7 @@ function setChartLang(changeLangIsCheck){
|
|
options.value.tooltip.formatter = LangType.value == 'en'?options.value.tooltip.formatterEn:options.value.tooltip.formatterZh
|
|
options.value.tooltip.formatter = LangType.value == 'en'?options.value.tooltip.formatterEn:options.value.tooltip.formatterZh
|
|
//x轴
|
|
//x轴
|
|
if(Source==2){
|
|
if(Source==2){
|
|
- options.value.xAxis.categories = commodityXData.value.map(_ => {
|
|
|
|
- LangType.value == 'en'?_.NameEn:_.Name
|
|
|
|
- });
|
|
|
|
|
|
+ options.value.xAxis.categories = commodityXData.value.filter(_=>_.IsHide===0).map(_ => LangType.value == 'en'?_.NameEn:_.Name);
|
|
}
|
|
}
|
|
if([3].includes(Source)){
|
|
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.textZh
|
|
options.value.xAxis.title.text=LangType.value == 'en'?(options.value.xAxis.title.textEn||options.value.xAxis.title.textZh):options.value.xAxis.title.textZh
|
|
@@ -636,6 +634,9 @@ function setSectionalCombinationChart(e){
|
|
name:item.SeriesName,
|
|
name:item.SeriesName,
|
|
nameZh:item.SeriesName,
|
|
nameZh:item.SeriesName,
|
|
nameEn:item.SeriesNameEn,
|
|
nameEn:item.SeriesNameEn,
|
|
|
|
+ unitName:UnitList[yTitleMap[item.IsAxis][0]],
|
|
|
|
+ unitNameCh:UnitList[yTitleMap[item.IsAxis][0]],
|
|
|
|
+ unitNameEn:UnitList[yTitleMap[item.IsAxis][0]]?UnitList[yTitleMap[item.IsAxis][1]]:'',
|
|
color: item.ChartColor,
|
|
color: item.ChartColor,
|
|
lineWidth: Number(item.ChartWidth)||(chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth),
|
|
lineWidth: Number(item.ChartWidth)||(chartTheme&&chartTheme.lineOptionList[lineIndex].lineWidth),
|
|
borderWidth: 1,
|
|
borderWidth: 1,
|
|
@@ -659,10 +660,26 @@ function setSectionalCombinationChart(e){
|
|
seriesData.push(obj)
|
|
seriesData.push(obj)
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ const tooltip={
|
|
|
|
+ formatter:function () {
|
|
|
|
+ return `<b>${this.x}</b>
|
|
|
|
+ <br><span style="color:${this.color}">\u25CF</span>${this.x}:${this.y} ${this.series.options.unitName}`
|
|
|
|
+ },
|
|
|
|
+ formatterCh:function () {
|
|
|
|
+ return `<b>${this.x}</b>
|
|
|
|
+ <br><span style="color:${this.color}">\u25CF</span>${this.x}:${this.y} ${this.series.options.unitNameCh}`
|
|
|
|
+ },
|
|
|
|
+ formatterEn:function () {
|
|
|
|
+ return `<b>${this.x}</b>
|
|
|
|
+ <br><span style="color:${this.color}">\u25CF</span>${this.x}:${this.y} ${this.series.options.unitNameEn}`
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
return {
|
|
return {
|
|
title: {
|
|
title: {
|
|
text:''
|
|
text:''
|
|
},
|
|
},
|
|
|
|
+ tooltip,
|
|
series: seriesData,
|
|
series: seriesData,
|
|
yAxis: yAxis,
|
|
yAxis: yAxis,
|
|
xAxis,
|
|
xAxis,
|
|
@@ -1724,7 +1741,7 @@ const setCommodityChart = (leftMin,leftMax) => {
|
|
//x轴
|
|
//x轴
|
|
let xAxis = {
|
|
let xAxis = {
|
|
...scatterXAxis,
|
|
...scatterXAxis,
|
|
- categories: commodityXData.value.map(_ => _.Name),
|
|
|
|
|
|
+ categories: commodityXData.value.filter(_=>_.IsHide===0).map(_ => _.Name),
|
|
tickWidth: 1,
|
|
tickWidth: 1,
|
|
labels: {
|
|
labels: {
|
|
style: {
|
|
style: {
|
|
@@ -1873,14 +1890,21 @@ function filterInvalidData(item){
|
|
// console.log('last_index',last_index)
|
|
// console.log('last_index',last_index)
|
|
|
|
|
|
let arr = item.Value.map((item,index) => {
|
|
let arr = item.Value.map((item,index) => {
|
|
- if(index < first_index || index > last_index) {
|
|
|
|
- return null
|
|
|
|
- }else {
|
|
|
|
- return item
|
|
|
|
- }
|
|
|
|
|
|
+ if(index < first_index || index > last_index) {
|
|
|
|
+ return null
|
|
|
|
+ }else {
|
|
|
|
+ return item
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // 根据设置的x轴显示隐藏去除值
|
|
|
|
+ let temArr=[]
|
|
|
|
+ commodityXData.value.forEach((i,index)=>{
|
|
|
|
+ if(i.IsHide!==1){
|
|
|
|
+ temArr.push(arr[index]||null)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
- return arr;
|
|
|
|
|
|
+ return temArr;
|
|
}
|
|
}
|
|
function initCommodityData(data){
|
|
function initCommodityData(data){
|
|
const { XDataList,YDataList,EdbInfoList,ChartInfo,DataResp } = data;
|
|
const { XDataList,YDataList,EdbInfoList,ChartInfo,DataResp } = data;
|