Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
2 merge requests!457Resolve "v1.4 ecolyodemo Pb échelle écran multi ?",!435WIP: 1.4.0
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment