diff --git a/frontend/app/pages/commune/[slug]/index.vue b/frontend/app/pages/commune/[slug]/index.vue index 1fb6f64..15702cf 100644 --- a/frontend/app/pages/commune/[slug]/index.vue +++ b/frontend/app/pages/commune/[slug]/index.vue @@ -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(' ') }