fixing range validation and tests.

This commit is contained in:
Will Charczuk 2017-03-02 14:39:32 -08:00
parent b2de33058f
commit 17b28beae8
2 changed files with 63 additions and 1 deletions

View file

@ -295,6 +295,9 @@ func (c Chart) checkRanges(xr, yr, yra Range) error {
if math.IsNaN(xDelta) {
return errors.New("nan x-range delta")
}
if xDelta == 0 {
return errors.New("zero x-range delta; there needs to be at least (2) values")
}
yDelta := yr.GetDelta()
if math.IsInf(yDelta, 0) {