moved javascript for the legend from main.scala.html to a more suitable place (dashboard.js)