Discover: SidebarFilter Timeframes fix chart y max value and min value.

This commit is contained in:
chiayin
2023-05-24 12:49:19 +08:00
parent a9c7723e6e
commit 0e510e8270

View File

@@ -63,6 +63,7 @@ export default{
let e = 2;
let f = this.filterTimeframe.data[1].y;
b = (e*d - a*d - f*a - f*c) / (e - c - a)
b < 0 ? b = 0 : b;
// y 軸最大值
let ma = 9;
let mb = this.filterTimeframe.data[8].y;
@@ -70,7 +71,8 @@ export default{
let md = this.filterTimeframe.data[9].y;
let me = 11;
let mf;
mf = (mb*me - mb*mc -md*me + md*ma) / (ma - mc)
mf = (mb*me - mb*mc -md*me + md*ma) / (ma - mc);
mf < 0 ? mf = 0 : mf;
// 添加最小值
data.unshift({