误差图x、y轴文字修改
parent
7d2a192430
commit
28a38b22f6
|
@ -493,7 +493,6 @@ export default {
|
|||
allData2.push(item);
|
||||
}
|
||||
});
|
||||
console.log(allData1, allData2);
|
||||
// 计算两点角度
|
||||
let bearingArr = [];
|
||||
allData1.forEach((item, index) => {
|
||||
|
@ -516,7 +515,7 @@ export default {
|
|||
},
|
||||
animation: false,
|
||||
xAxis: {
|
||||
name: "经度(°)",
|
||||
name: "X",
|
||||
nameLocation: "middle",
|
||||
nameTextStyle: {
|
||||
lineHeight: 30,
|
||||
|
@ -527,12 +526,17 @@ export default {
|
|||
max: Number(xMax + avgxVal * 2).toFixed(4),
|
||||
axisLabel: {
|
||||
formatter: function (value) {
|
||||
return Number(value);
|
||||
let pt = turf.point([value, 0]);
|
||||
let converted = turf.toMercator(pt);
|
||||
let num = converted.geometry.coordinates[0];
|
||||
const p = Math.floor(Math.log(num) / Math.LN10);
|
||||
const n = num * 10 ** -p;
|
||||
return `${n.toFixed(4)}xe${p}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
name: "纬度(°)",
|
||||
name: "Y",
|
||||
nameTextStyle: {
|
||||
lineHeight: 30,
|
||||
height: 60,
|
||||
|
@ -542,7 +546,12 @@ export default {
|
|||
max: Number(yMax + avgyVal * 2).toFixed(4),
|
||||
axisLabel: {
|
||||
formatter: function (value) {
|
||||
return Number(value);
|
||||
let pt = turf.point([0, value]);
|
||||
let converted = turf.toMercator(pt);
|
||||
let num = converted.geometry.coordinates[1];
|
||||
const p = Math.floor(Math.log(num) / Math.LN10);
|
||||
const n = num * 10 ** -p;
|
||||
return `${n.toFixed(4)}xe${p}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue