dc-js / dc.leaflet.js

DC charts using Leaflet maps
Apache License 2.0
52 stars 24 forks source link

strange rounding in legend #11

Closed gordonwoodhull closed 8 years ago

gordonwoodhull commented 8 years ago

seems to have rounded all of the bounds except for one

image

KatiRG commented 8 years ago

What input data are you using? I can try to reproduce it.

KatiRG commented 8 years ago

For some reason, I am getting this error in the console after pulling the master branch:

ReferenceError: tip is not defined chart.selectAll("path").call(tip);

gordonwoodhull commented 8 years ago

I'm testing it from an R package, so I'm not sure how to reproduce it in pure JS.

The .tip error is just some test code I accidentally checked in - I'll remove it today.

gordonwoodhull commented 8 years ago

It was just that grade[0] wasn't rounded, while the rest were:

        grades[0] = Math.round(minValue);

I think this legend code could use to be generalized for cases like where the color scale is not equally divided, or where the grades are not integers, but we can deal with that as we go along. Thanks!