Commit 2e6eaf63 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

Merge branch '180-v1-4-ecolyodemo-pb-echelle-ecran-multi' into 'dev'

Resolve "v1.4 ecolyodemo Pb échelle écran multi ?"

Closes #180

See merge request web-et-numerique/llle_project/ecolyo!457
parents 001d4568 18c12b71
......@@ -49,11 +49,19 @@ const BarChart: React.FC<BarChartProps> = ({
const maxCompare = chartData.comparisonData
? Math.max(...chartData.comparisonData.map(d => d.value))
: 0
let max = chartData.actualData
const max = chartData.actualData
? Math.max(...chartData.actualData.map(d => d.value))
: 0
max = max <= 0 ? 15 : max
return showCompare ? Math.max(max, maxCompare) : max
if (showCompare) {
if (max <= 0 && maxCompare <= 0) return 15
else return Math.max(max, maxCompare)
} else {
if (max <= 0) {
return 15
} else return max
}
}
const xScale: ScaleBand<string> = scaleBand()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment