feat: support radar option of echarts
This commit is contained in:
parent
570828d35f
commit
b93d096633
10 changed files with 411 additions and 56 deletions
32
line.go
32
line.go
|
|
@ -55,25 +55,23 @@ func (d *Draw) lineFill(points []Point, style LineStyle) {
|
|||
if !(s.ShouldDrawStroke() && s.ShouldDrawFill()) {
|
||||
return
|
||||
}
|
||||
r := d.Render
|
||||
var x, y int
|
||||
s.GetFillOptions().WriteDrawingOptionsToRenderer(r)
|
||||
for index, point := range points {
|
||||
x = point.X
|
||||
y = point.Y
|
||||
if index == 0 {
|
||||
d.moveTo(x, y)
|
||||
} else {
|
||||
d.lineTo(x, y)
|
||||
}
|
||||
}
|
||||
height := d.Box.Height()
|
||||
d.lineTo(x, height)
|
||||
|
||||
newPoints := make([]Point, len(points))
|
||||
copy(newPoints, points)
|
||||
x0 := points[0].X
|
||||
y0 := points[0].Y
|
||||
d.lineTo(x0, height)
|
||||
d.lineTo(x0, y0)
|
||||
r.Fill()
|
||||
height := d.Box.Height()
|
||||
newPoints = append(newPoints, Point{
|
||||
X: points[len(points)-1].X,
|
||||
Y: height,
|
||||
}, Point{
|
||||
X: x0,
|
||||
Y: height,
|
||||
}, Point{
|
||||
X: x0,
|
||||
Y: y0,
|
||||
})
|
||||
d.fill(newPoints, style.Style())
|
||||
}
|
||||
|
||||
func (d *Draw) lineDot(points []Point, style LineStyle) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue