feat: support null value for line chart
This commit is contained in:
parent
bb9af986be
commit
50605907c7
5 changed files with 32 additions and 2 deletions
|
|
@ -438,11 +438,18 @@ func (p *Painter) MeasureTextMaxWidthHeight(textList []string) (int, int) {
|
|||
}
|
||||
|
||||
func (p *Painter) LineStroke(points []Point) *Painter {
|
||||
shouldMoveTo := false
|
||||
for index, point := range points {
|
||||
x := point.X
|
||||
y := point.Y
|
||||
if index == 0 {
|
||||
if y == math.MaxInt {
|
||||
p.Stroke()
|
||||
shouldMoveTo = true
|
||||
continue
|
||||
}
|
||||
if shouldMoveTo || index == 0 {
|
||||
p.MoveTo(x, y)
|
||||
shouldMoveTo = false
|
||||
} else {
|
||||
p.LineTo(x, y)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue