testing histogram series.

This commit is contained in:
Will Charczuk 2016-07-28 16:36:30 -07:00
parent d088213b1e
commit bff8e074fd
9 changed files with 203 additions and 18 deletions

View file

@ -47,3 +47,21 @@ func TestXAxisGetTicksWithUserDefaults(t *testing.T) {
ticks := xa.GetTicks(r, xr, styleDefaults, vf)
assert.Len(ticks, 1)
}
func TestXAxisMeasure(t *testing.T) {
assert := assert.New(t)
f, err := GetDefaultFont()
assert.Nil(err)
style := Style{
Font: f,
FontSize: 10.0,
}
r, err := PNG(100, 100)
assert.Nil(err)
ticks := []Tick{{Value: 1.0, Label: "1.0"}, {Value: 2.0, Label: "2.0"}, {Value: 3.0, Label: "3.0"}}
xa := XAxis{}
xab := xa.Measure(r, Box{0, 0, 100, 100}, &ContinuousRange{Min: 1.0, Max: 3.0, Domain: 100}, style, ticks)
assert.Equal(122, xab.Width())
assert.Equal(21, xab.Height())
}