ngx-line-chart
Advanced tools
Comparing version 0.0.1-beta.4 to 0.0.1-beta.5
19
index.js
@@ -224,2 +224,3 @@ import { CommonModule } from '@angular/common'; | ||
var /** @type {?} */ max = scaledPoints[scaledPoints.length - 1]; | ||
var /** @type {?} */ midLabelValue = ChartComponent.findMiddle(this.dataSets[setIndex].points.map(function (point) { return point.y; })); | ||
return [ | ||
@@ -230,3 +231,3 @@ { | ||
}, | ||
__assign({}, mid, { label: this.getYLabel(ChartComponent.findMiddle(this.dataSets[setIndex].points.map(function (point) { return point.y; }))), y: this.height / 2 }), | ||
__assign({}, mid, { label: this.getYLabel(midLabelValue), y: this.height / 2 }), | ||
__assign({}, max, { label: this.getYLabel(max.originalY) }) | ||
@@ -265,8 +266,12 @@ ]; | ||
var /** @type {?} */ minAndMaxY = ChartComponent.findMinAndMax(points.map(function (point) { return point.y; })); | ||
return points.map(function (point) { return ({ | ||
originalX: point.x, | ||
originalY: point.y, | ||
x: Math.max(ChartComponent.scaleValueBetween0And1(point.x, minAndMaxX, 'x') * (_this.width - _this.padding), _this.padding), | ||
y: Math.max(_this.height - ChartComponent.scaleValueBetween0And1(point.y, minAndMaxY, 'y') * _this.height, _this.padding) | ||
}); }).sort(function (a, b) { return a.originalX - b.originalX; }); | ||
return points.map(function (point) { | ||
var /** @type {?} */ scaledY = ChartComponent.scaleValueBetween0And1(point.y, minAndMaxY, 'y'); | ||
var /** @type {?} */ scaledX = ChartComponent.scaleValueBetween0And1(point.x, minAndMaxX, 'x'); | ||
return { | ||
originalX: point.x, | ||
originalY: point.y, | ||
x: Math.max(scaledX * (_this.width - _this.padding), _this.padding), | ||
y: Math.min(Math.max(_this.height - scaledY * _this.height, _this.padding), _this.height - _this.padding) | ||
}; | ||
}).sort(function (a, b) { return a.originalX - b.originalX; }); | ||
}; | ||
@@ -273,0 +278,0 @@ /** |
@@ -228,2 +228,3 @@ (function (global, factory) { | ||
var /** @type {?} */ max = scaledPoints[scaledPoints.length - 1]; | ||
var /** @type {?} */ midLabelValue = ChartComponent.findMiddle(this.dataSets[setIndex].points.map(function (point) { return point.y; })); | ||
return [ | ||
@@ -234,3 +235,3 @@ { | ||
}, | ||
__assign({}, mid, { label: this.getYLabel(ChartComponent.findMiddle(this.dataSets[setIndex].points.map(function (point) { return point.y; }))), y: this.height / 2 }), | ||
__assign({}, mid, { label: this.getYLabel(midLabelValue), y: this.height / 2 }), | ||
__assign({}, max, { label: this.getYLabel(max.originalY) }) | ||
@@ -269,8 +270,12 @@ ]; | ||
var /** @type {?} */ minAndMaxY = ChartComponent.findMinAndMax(points.map(function (point) { return point.y; })); | ||
return points.map(function (point) { return ({ | ||
originalX: point.x, | ||
originalY: point.y, | ||
x: Math.max(ChartComponent.scaleValueBetween0And1(point.x, minAndMaxX, 'x') * (_this.width - _this.padding), _this.padding), | ||
y: Math.max(_this.height - ChartComponent.scaleValueBetween0And1(point.y, minAndMaxY, 'y') * _this.height, _this.padding) | ||
}); }).sort(function (a, b) { return a.originalX - b.originalX; }); | ||
return points.map(function (point) { | ||
var /** @type {?} */ scaledY = ChartComponent.scaleValueBetween0And1(point.y, minAndMaxY, 'y'); | ||
var /** @type {?} */ scaledX = ChartComponent.scaleValueBetween0And1(point.x, minAndMaxX, 'x'); | ||
return { | ||
originalX: point.x, | ||
originalY: point.y, | ||
x: Math.max(scaledX * (_this.width - _this.padding), _this.padding), | ||
y: Math.min(Math.max(_this.height - scaledY * _this.height, _this.padding), _this.height - _this.padding) | ||
}; | ||
}).sort(function (a, b) { return a.originalX - b.originalX; }); | ||
}; | ||
@@ -277,0 +282,0 @@ /** |
{ | ||
"name": "ngx-line-chart", | ||
"version": "0.0.1-beta.4", | ||
"version": "0.0.1-beta.5", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
46480
778