Update linechart.go

This commit is contained in:
韩拓 2017-01-06 01:13:08 +08:00 committed by GitHub
parent f0de1c5506
commit 322b4a1dd4
1 changed files with 5 additions and 1 deletions

View File

@ -151,7 +151,11 @@ func (lc *LineChart) renderDot() Buffer {
u = -1 u = -1
} }
for i := oy + u; i != y; i += u { for i := oy + u; i != y; i += u {
buf.Set(x, i, c) dx := -1
if u*(i-oy) >= u*(y-oy)/2 {
dx = 0
}
buf.Set(x+dx, i, c)
} }
} }
oy = y oy = y