forked from EHV/sejeteralo
Compare commits
3 Commits
daad6bb1d5
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| db964d44b2 | |||
| b5d58911fb | |||
| 8b1dd9b170 |
@@ -1295,14 +1295,16 @@ const gridPrices2 = computed(() => {
|
||||
return arr
|
||||
})
|
||||
|
||||
function toPolyline(vols: number[] | undefined, vals: number[] | undefined, cyFn: (v: number) => number): string {
|
||||
function toPolyline(vols: number[] | undefined, vals: number[] | undefined, cyFn: (v: number) => number, minVol = 15): string {
|
||||
if (!vols?.length || !vals?.length) return ''
|
||||
const pts: string[] = []
|
||||
for (let i = 0; i < vols.length; i += 4) {
|
||||
pts.push(`${cx2(vols[i]!)},${cyFn(vals[i]!)}`)
|
||||
const v = vols[i]!
|
||||
if (v < minVol) continue
|
||||
pts.push(`${cx2(v)},${cyFn(vals[i]!)}`)
|
||||
}
|
||||
const last = vols.length - 1
|
||||
if (last % 4 !== 0) pts.push(`${cx2(vols[last]!)},${cyFn(vals[last]!)}`)
|
||||
if (last % 4 !== 0 && vols[last]! >= minVol) pts.push(`${cx2(vols[last]!)},${cyFn(vals[last]!)}`)
|
||||
return pts.join(' ')
|
||||
}
|
||||
|
||||
@@ -1391,7 +1393,7 @@ const margPriceLine = computed(() => {
|
||||
const pts: string[] = []
|
||||
for (let i = 0; i < vols.length; i += 3) {
|
||||
const v = vols[i]!
|
||||
if (v > margVolMax.value) break
|
||||
if (v < 15 || v > margVolMax.value) continue // ← changer break par continue, et ajouter v < 15
|
||||
pts.push(`${margCx(v)},${margCyPrice(prices[i]!)}`)
|
||||
}
|
||||
return pts.join(' ')
|
||||
@@ -1406,7 +1408,7 @@ const margAvgPriceWithAboLine = computed(() => {
|
||||
const pts: string[] = []
|
||||
for (let i = 0; i < vols.length; i += 3) {
|
||||
const v = vols[i]!
|
||||
if (v < 1 || v > margVolMax.value) continue
|
||||
if (v < 15 || v > margVolMax.value) continue
|
||||
const avgP = citizenAbo.value / v + p0lin
|
||||
if (avgP <= margPriceMax.value * 1.5) {
|
||||
pts.push(`${margCx(v)},${margCyPrice(avgP)}`)
|
||||
|
||||
Reference in New Issue
Block a user