Make Y-axis labels accuracy depend on graph

Now the values on Y-axis label and on graph points labels have variable accuracy (decimal places) depending on range of the values (difference between min and max value on the graph). It prevents situation shown on the image attached:

The first one shows current rounding - after zooming the graph you can't distinguish any of the values on the axis and graph points labels - they are all the same. The second one shows almost the same graph, but with dynamically scaled values (don't mind the units, I forgot to change to ms).

![values](https://cloud.githubusercontent.com/assets/3197917/3764001/1ae7a432-18ab-11e4-9bd2-d03d03c02f0f.png)

Explanation for automatic test failure - function for rounding numbers instead of number of decimals takes difference between min and max in graph as an argument and that makes the tests fail.
Here the min and max value on graph is calculated. For some reason min and max fields in many objects listed in this file are not filled so I wrote this piece of code.