Bugfix with vertical scale
This commit is contained in:
parent
b17a684dc5
commit
fdd6337554
@ -118,7 +118,7 @@ SVG.addPoints = function (graph, data) {
|
|||||||
// Compute new coordinates, knowing the min and max value to fit the graph in the container
|
// Compute new coordinates, knowing the min and max value to fit the graph in the container
|
||||||
SVG.newCoordinate = function(value, min, max, minValue, maxValue) {
|
SVG.newCoordinate = function(value, min, max, minValue, maxValue) {
|
||||||
var a = (maxValue - minValue) / (max - min);
|
var a = (maxValue - minValue) / (max - min);
|
||||||
return a * value - a * min + minValue;
|
return a *(value - min) + minValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Compute new X and Y values
|
// Compute new X and Y values
|
||||||
@ -127,7 +127,7 @@ SVG.getNewXY = function (minX, maxX, minY, maxY) {
|
|||||||
return function (x, y) {
|
return function (x, y) {
|
||||||
return {
|
return {
|
||||||
'x': SVG.newCoordinate(x, minX, maxX, SVG.marginLeft, SVG.parent_holder.offsetWidth - SVG.marginRight),
|
'x': SVG.newCoordinate(x, minX, maxX, SVG.marginLeft, SVG.parent_holder.offsetWidth - SVG.marginRight),
|
||||||
'y': SVG.newCoordinate(y, minY, maxY, 2*SVG.marginBottom, SVG.parent_holder.offsetWidth - SVG.marginTop)
|
'y': SVG.newCoordinate(y, minY, maxY, 2*SVG.marginBottom, SVG.parent_holder.offsetHeight - SVG.marginTop)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
2
timeline.min.js
vendored
2
timeline.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user