geostats - Javascript classification library samples

Github page - download (from github)

Sample 8 - finally, a choropleth representation (with openlayers)

Sample 9 - dynamic HTML legend with user input, feature count and callback function