1
0
forked from EHV/sejeteralo

Compare commits

..

3 Commits

Author SHA1 Message Date
nicoboy db964d44b2 amelioration courbe bleue prix 2026-05-01 22:22:11 +02:00
nicoboy b5d58911fb modification rendu courbe bleue prix moyen 2026-05-01 21:54:36 +02:00
nicoboy 8b1dd9b170 seuillage prix moyen >30 2026-05-01 21:26:16 +02:00
+7 -5
View File
@@ -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)}`)