forked from EHV/sejeteralo
amelioration courbe bleue prix
This commit is contained in:
@@ -1295,14 +1295,16 @@ const gridPrices2 = computed(() => {
|
|||||||
return arr
|
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 ''
|
if (!vols?.length || !vals?.length) return ''
|
||||||
const pts: string[] = []
|
const pts: string[] = []
|
||||||
for (let i = 0; i < vols.length; i += 4) {
|
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
|
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(' ')
|
return pts.join(' ')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user