[Plot] Expand range to give margin for points

Expand range to give some margin for points near the edge,
WTD-1406.
This commit is contained in:
Victor Woeltjen
2015-06-29 17:44:44 -07:00
parent fa8095d5bc
commit 397a545482
2 changed files with 31 additions and 4 deletions

View File

@ -187,7 +187,21 @@ define(
expect(updater.getDomainOffset()).toBeDefined();
});
it("provides some margin for the range", function () {
var mockObject = mockSubscription.getTelemetryObjects()[0];
mockSeries.getPointCount.andReturn(3);
mockSeries.getDomainValue.andCallFake(function (i) {
return 1000 + i * 1000;
});
mockSeries.getRangeValue.andCallFake(function (i) {
return 10 + i; // 10, 20, 30
});
updater.addHistorical(mockObject, mockSeries);
expect(updater.getOrigin()[1]).toBeLessThan(10);
expect(updater.getDimensions()[1]).toBeGreaterThan(20);
});
});
}
);
);