moved css into js
auto calculating min and max values to nice scale
moved default legend to right