|
@@ -492,7 +492,9 @@ function setChartLang(changeLangIsCheck){
|
|
|
options.value.tooltip.formatter = LangType.value == 'en'?options.value.tooltip.formatterEn:options.value.tooltip.formatterZh
|
|
|
//x轴
|
|
|
if(Source==2){
|
|
|
- options.value.xAxis.categories = commodityXData.value.filter(_=>_.IsHide===0).map(_ => LangType.value == 'en'?_.NameEn:_.Name);
|
|
|
+ options.value.xAxis.categories = commodityXData.value.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.textZh
|
|
@@ -662,17 +664,30 @@ function setSectionalCombinationChart(e){
|
|
|
|
|
|
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}`
|
|
|
+ let str=`<b>${this.points[0].x}</b>`
|
|
|
+ this.points.forEach(item=>{
|
|
|
+ const sObj=seriesData.find(_=>_.name===item.series.name)
|
|
|
+ str=str+`<br><span style="color:${item.color}">\u25CF</span>${sObj.name}:${item.y} ${sObj.unitNameCh}`
|
|
|
+ })
|
|
|
+ return str
|
|
|
},
|
|
|
formatterCh:function () {
|
|
|
- return `<b>${this.x}</b>
|
|
|
- <br><span style="color:${this.color}">\u25CF</span>${this.x}:${this.y} ${this.series.options.unitNameCh}`
|
|
|
+ let str=`<b>${this.points[0].x}</b>`
|
|
|
+ this.points.forEach(item=>{
|
|
|
+ const sObj=seriesData.find(_=>_.name===item.series.name)
|
|
|
+ str=str+`<br><span style="color:${item.color}">\u25CF</span>${sObj.nameCh}:${item.y} ${sObj.unitNameCh}`
|
|
|
+ })
|
|
|
+ return str
|
|
|
},
|
|
|
formatterEn:function () {
|
|
|
- return `<b>${this.x}</b>
|
|
|
- <br><span style="color:${this.color}">\u25CF</span>${this.x}:${this.y} ${this.series.options.unitNameEn}`
|
|
|
- }
|
|
|
+ let str=`<b>${this.points[0].x}</b>`
|
|
|
+ this.points.forEach(item=>{
|
|
|
+ const sObj=seriesData.find(_=>_.name===item.series.name)
|
|
|
+ str=str+`<br><span style="color:${item.color}">\u25CF</span>${sObj.nameEn}:${item.y} ${sObj.unitNameEn}`
|
|
|
+ })
|
|
|
+ return str
|
|
|
+ },
|
|
|
+ shared:true
|
|
|
}
|
|
|
|
|
|
return {
|
|
@@ -1741,7 +1756,7 @@ const setCommodityChart = (leftMin,leftMax) => {
|
|
|
//x轴
|
|
|
let xAxis = {
|
|
|
...scatterXAxis,
|
|
|
- categories: commodityXData.value.filter(_=>_.IsHide===0).map(_ => _.Name),
|
|
|
+ categories: commodityXData.value.map(_ => _.Name),
|
|
|
tickWidth: 1,
|
|
|
labels: {
|
|
|
style: {
|
|
@@ -1890,21 +1905,14 @@ function filterInvalidData(item){
|
|
|
// console.log('last_index',last_index)
|
|
|
|
|
|
let arr = item.Value.map((item,index) => {
|
|
|
- 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)
|
|
|
- }
|
|
|
+ if(index < first_index || index > last_index) {
|
|
|
+ return null
|
|
|
+ }else {
|
|
|
+ return item
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
- return temArr;
|
|
|
+ return arr;
|
|
|
}
|
|
|
function initCommodityData(data){
|
|
|
const { XDataList,YDataList,EdbInfoList,ChartInfo,DataResp } = data;
|