test: add series and legend test

This commit is contained in:
vicanso 2021-12-21 23:43:36 +08:00
parent acc758cb9a
commit a128a2513c
7 changed files with 398 additions and 77 deletions

View file

@ -72,6 +72,7 @@ func TestBarSeriesGetWidthValues(t *testing.T) {
barWidth: 80,
}, widthValues)
// 指定margin
bs.Margin = 5
widthValues = bs.getWidthValues(300)
assert.Equal(barSeriesWidthValues{
@ -81,6 +82,7 @@ func TestBarSeriesGetWidthValues(t *testing.T) {
barWidth: 80,
}, widthValues)
// 指定bar的宽度
bs.BarWidth = 60
widthValues = bs.getWidthValues(300)
assert.Equal(barSeriesWidthValues{
@ -89,7 +91,6 @@ func TestBarSeriesGetWidthValues(t *testing.T) {
margin: 5,
barWidth: 60,
}, widthValues)
}
func TestBarSeriesRender(t *testing.T) {