fixing range validation and tests.
This commit is contained in:
parent
b2de33058f
commit
17b28beae8
2 changed files with 63 additions and 1 deletions
3
chart.go
3
chart.go
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue