updates + tests
This commit is contained in:
parent
1144b80a46
commit
1555902fc4
13 changed files with 207 additions and 2 deletions
22
first_value_annotation_test.go
Normal file
22
first_value_annotation_test.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package chart
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/blend/go-sdk/assert"
|
||||
)
|
||||
|
||||
func TestFirstValueAnnotation(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
series := ContinuousSeries{
|
||||
XValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0},
|
||||
YValues: []float64{5.0, 3.0, 3.0, 2.0, 1.0},
|
||||
}
|
||||
|
||||
fva := FirstValueAnnotation(series)
|
||||
assert.NotEmpty(fva.Annotations)
|
||||
fvaa := fva.Annotations[0]
|
||||
assert.Equal(1, fvaa.XValue)
|
||||
assert.Equal(5, fvaa.YValue)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue