Skip to content

Commit

Permalink
bug correction
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaffuri committed Sep 19, 2018
1 parent 4d3ea69 commit 9695587
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/eurostat-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,15 @@
.shapePadding(out.legendShapePadding_)
.labelFormat(d3.format(".2f"))
//.labels(d3.legendHelpers.thresholdLabels)
.labels(function({i,genLength,generatedLabels,labelDelimiter}) {
if (i === 0) {
const values = generatedLabels[i].split(` ${labelDelimiter} `)
.labels(function(d) {
if (d.i === 0) {
const values = d.generatedLabels[d.i].split(` ${d.labelDelimiter} `)
return `< ${values[1]}`
} else if (i === genLength - 1) {
const values = generatedLabels[i].split(` ${labelDelimiter} `)
} else if (d.i === d.genLength - 1) {
const values = d.generatedLabels[d.i].split(` ${d.labelDelimiter} `)
return `>= ${values[0]} `
}
return generatedLabels[i]
return d.generatedLabels[d.i]
})
.labelDelimiter(out.legendLabelDelimiter_)
.labelOffset(out.legendLabelOffset_)
Expand Down

0 comments on commit 9695587

Please sign in to comment.