diff --git a/axis.go b/axis.go
index 8e5bfda..3c0484c 100644
--- a/axis.go
+++ b/axis.go
@@ -265,6 +265,7 @@ func (a *axisPainter) Render() (Box, error) {
// 显示辅助线
if opt.SplitLineShow {
style.StrokeColor = opt.SplitLineColor
+ style.StrokeWidth = 1
top.OverrideDrawingStyle(style)
if isVertical {
x0 := p.Width()
@@ -273,7 +274,9 @@ func (a *axisPainter) Render() (Box, error) {
x0 = 0
x1 = top.Width() - p.Width()
}
- for _, y := range autoDivide(height, tickCount) {
+ yValues := autoDivide(height, tickCount)
+ yValues = yValues[0 : len(yValues)-1]
+ for _, y := range yValues {
top.LineStroke([]Point{
{
X: x0,
diff --git a/axis_test.go b/axis_test.go
index 17fe8d6..d0cff41 100644
--- a/axis_test.go
+++ b/axis_test.go
@@ -113,7 +113,7 @@ func TestAxis(t *testing.T) {
}).Render()
return p.Bytes()
},
- result: "",
+ result: "",
},
// 右侧
{
@@ -135,7 +135,7 @@ func TestAxis(t *testing.T) {
}).Render()
return p.Bytes()
},
- result: "",
+ result: "",
},
// 顶部
{
diff --git a/bar_chart_test.go b/bar_chart_test.go
index f1bd688..bee0583 100644
--- a/bar_chart_test.go
+++ b/bar_chart_test.go
@@ -102,7 +102,7 @@ func TestBarChart(t *testing.T) {
}
return p.Bytes()
},
- result: "",
+ result: "",
},
}
diff --git a/chart_option_test.go b/chart_option_test.go
index 1238422..6f331b3 100644
--- a/chart_option_test.go
+++ b/chart_option_test.go
@@ -204,7 +204,7 @@ func TestLineRender(t *testing.T) {
assert.Nil(err)
data, err := p.Bytes()
assert.Nil(err)
- assert.Equal("", string(data))
+ assert.Equal("", string(data))
}
func TestBarRender(t *testing.T) {
@@ -277,7 +277,7 @@ func TestBarRender(t *testing.T) {
assert.Nil(err)
data, err := p.Bytes()
assert.Nil(err)
- assert.Equal("", string(data))
+ assert.Equal("", string(data))
}
func TestHorizontalBarRender(t *testing.T) {
@@ -326,7 +326,7 @@ func TestHorizontalBarRender(t *testing.T) {
assert.Nil(err)
data, err := p.Bytes()
assert.Nil(err)
- assert.Equal("", string(data))
+ assert.Equal("", string(data))
}
func TestPieRender(t *testing.T) {
@@ -368,7 +368,7 @@ func TestPieRender(t *testing.T) {
assert.Nil(err)
data, err := p.Bytes()
assert.Nil(err)
- assert.Equal("", string(data))
+ assert.Equal("", string(data))
}
func TestRadarRender(t *testing.T) {
@@ -419,7 +419,7 @@ func TestRadarRender(t *testing.T) {
assert.Nil(err)
data, err := p.Bytes()
assert.Nil(err)
- assert.Equal("", string(data))
+ assert.Equal("", string(data))
}
func TestFunnelRender(t *testing.T) {
@@ -447,5 +447,5 @@ func TestFunnelRender(t *testing.T) {
assert.Nil(err)
data, err := p.Bytes()
assert.Nil(err)
- assert.Equal("", string(data))
+ assert.Equal("", string(data))
}
diff --git a/charts.go b/charts.go
index d65f3c9..185e638 100644
--- a/charts.go
+++ b/charts.go
@@ -316,9 +316,8 @@ func Render(opt ChartOption, opts ...OptionFunc) (*Painter, error) {
TitleOption: opt.Title,
LegendOption: opt.Legend,
axisReversed: axisReversed,
- }
- if isChild {
- renderOpt.backgroundIsFilled = true
+ // 前置已设置背景色
+ backgroundIsFilled: true,
}
if len(pieSeriesList) != 0 ||
len(radarSeriesList) != 0 ||
diff --git a/echarts_test.go b/echarts_test.go
index 8deda2d..5c2dbad 100644
--- a/echarts_test.go
+++ b/echarts_test.go
@@ -578,5 +578,5 @@ func TestRenderEChartsToSVG(t *testing.T) {
]
}`)
assert.Nil(err)
- assert.Equal("", string(data))
+ assert.Equal("", string(data))
}
diff --git a/horizontal_bar_chart_test.go b/horizontal_bar_chart_test.go
index 5555df6..e078c4a 100644
--- a/horizontal_bar_chart_test.go
+++ b/horizontal_bar_chart_test.go
@@ -83,7 +83,7 @@ func TestHorizontalBarChart(t *testing.T) {
}
return p.Bytes()
},
- result: "",
+ result: "",
},
}
for _, tt := range tests {
diff --git a/line_chart_test.go b/line_chart_test.go
index 856cdf3..e169f90 100644
--- a/line_chart_test.go
+++ b/line_chart_test.go
@@ -117,7 +117,7 @@ func TestLineChart(t *testing.T) {
}
return p.Bytes()
},
- result: "",
+ result: "",
},
{
render: func(p *Painter) ([]byte, error) {
@@ -201,7 +201,7 @@ func TestLineChart(t *testing.T) {
}
return p.Bytes()
},
- result: "",
+ result: "",
},
}