Open okonet opened 8 years ago
Looking at code, it seems like all calculations are done on the scaled points and not original data set, which leads to wrong results. I.e. max([0,1]) => 1
but in SVG, [0, 1]
is mapped in reverse coordinates: [18, 2]
for the height
set to 20
. But max([18, 2]) => 18
, which is the first point. This is clearly incorrect.
All calculations must occur on the original data set and then the value must be mapped using the scale function.
This is also why #30 happening
I was able to replicate this bug as well. You are correct, the values used are incorrect.
You can see that setting the height as 60 for example, you can use the reference line with custom value of 60 and that will be your min. A custom value of 0 will be your max.
should be at the bottom. Right now it looks like this:
Same goes for
max