Add localization and metric support for map

Until now only energy and stats were translated / converted to support metric
units.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Translate (and better position) start time / end time labels

This looks much nicer - and I had forgotten to translate this in the energy and
stats pages as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly propagate language and metric / imperial settings

Don't forget these settings when changing the date ranges. Similarly, when
visualize.js redirects the client to force a correctly constructed query the
language and metric parameters need to be appended as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix incorrect translation

Used the wrong key string for the translation.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Several map fixes

Make sure that the map progress doesn't stall out (especially the progress
slider should behave much more sanely now).

Prevent us from resending the same AJAX request to the server more than once.

Fix the calculation for how much data should be requested from the server via
AJAX (I HATE the type confusion in Javascript... '+' between two variables
behaves in completely braindead ways).

Fix the condition that is used to recognize when we no longer need to get
updates from the server.

Make sure that the asynchronous drawing routine continues to run after we stop
receiving AJAX updates from the server, but that it is no longer called once
everything is drawn.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move conversion functions and string variable into lib.js

This avoids duplication and makes things easier to maintain. It does add a
small amount of overhead but that seems negligible when looking at load times
and processing times.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use the conversion functions

It turns out this was not as straight forward as I assumed when implementing
things. Given the massive amount of data that might have to be converted the
lookup and function call overhead made using the more elegant conversion
function way too slow when convering the values in the large arrays. But at
least for these two values there was no difference so I used this "just
because".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Improve the hover behavior in stats

With this change the hover function finally notices if we are hovering over a
different series within the same data point - so we now get the correct hover
behavior when moving the mouse over the different bars for the same data point
and most importantly we can get the tooltip to pop up for the average if that
ends up being overlaid ontop of the energy bar (which typically happens in a
weekly chart).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Merge pull request #58 from dirkhh/variousFixes

Various fixes