-
Notifications
You must be signed in to change notification settings - Fork 1
/
theme_test.go
206 lines (167 loc) · 82.4 KB
/
theme_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
package charts
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/wcharczuk/go-chart/v2/drawing"
)
func TestInstallGetTheme(t *testing.T) {
t.Parallel()
InstallTheme("test", ThemeOption{IsDarkMode: true})
assert.NotNil(t, GetTheme("test"))
assert.NotEqual(t, GetDefaultTheme(), GetTheme("test"))
}
func TestGetPreferredTheme(t *testing.T) {
t.Parallel()
t.Run("default", func(t *testing.T) {
assert.Equal(t, getPreferredTheme(nil), GetDefaultTheme())
})
t.Run("provided", func(t *testing.T) {
theme := GetTheme(ThemeGrafana)
assert.Equal(t, getPreferredTheme(theme), theme)
})
}
func TestDefaultTheme(t *testing.T) {
t.Parallel()
assert.Equal(t, GetTheme(ThemeLight), GetDefaultTheme())
assert.Equal(t, GetTheme("Unknown Theme"), GetDefaultTheme())
}
func renderTestLineChartWithThemeName(t *testing.T, fullChart bool, themeName string) string {
t.Helper()
return renderTestLineChartWithTheme(t, fullChart, GetTheme(themeName))
}
func renderTestLineChartWithTheme(t *testing.T, fullChart bool, theme ColorPalette) string {
t.Helper()
p, err := NewPainter(PainterOptions{
OutputFormat: ChartOutputSVG,
Width: 600,
Height: 400,
})
require.NoError(t, err)
opt := makeFullLineChartOption()
if len(opt.YAxis) == 0 {
opt.YAxis = []YAxisOption{{}}
}
opt.YAxis[0].LabelCount = 5
opt.YAxis[0].LabelSkipCount = 1
if !fullChart {
opt.Title.Show = False()
opt.SymbolShow = False()
}
opt.Theme = theme
_, err = NewLineChart(p, opt).Render()
require.NoError(t, err)
data, err := p.Bytes()
require.NoError(t, err)
return string(data)
}
func TestThemeLight(t *testing.T) {
t.Parallel()
svg := renderTestLineChartWithThemeName(t, true, ThemeLight)
assertEqualSVG(t, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\">\\n<path d=\"M 0 0\nL 600 0\nL 600 400\nL 0 400\nL 0 0\" style=\"stroke-width:0;stroke:none;fill:rgba(255,255,255,1.0)\"/><path d=\"M 20 19\nL 50 19\" style=\"stroke-width:3;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><circle cx=\"35\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><text x=\"52\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Email</text><path d=\"M 111 19\nL 141 19\" style=\"stroke-width:3;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><circle cx=\"126\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><text x=\"143\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Union Ads</text><path d=\"M 234 19\nL 264 19\" style=\"stroke-width:3;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><circle cx=\"249\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><text x=\"266\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Video Ads</text><path d=\"M 357 19\nL 387 19\" style=\"stroke-width:3;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><circle cx=\"372\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><text x=\"389\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Direct</text><path d=\"M 450 19\nL 480 19\" style=\"stroke-width:3;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><circle cx=\"465\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><text x=\"482\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Search Engine</text><text x=\"10\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Line</text><text x=\"19\" y=\"52\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">1.4k</text><text x=\"22\" y=\"209\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">700</text><text x=\"40\" y=\"367\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">0</text><path d=\"M 59 45\nL 590 45\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 123\nL 590 123\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 202\nL 590 202\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 281\nL 590 281\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 365\nL 59 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 134 365\nL 134 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 210 365\nL 210 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 286 365\nL 286 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 362 365\nL 362 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 438 365\nL 438 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 514 365\nL 514 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 590 365\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 59 360\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><text x=\"81\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Mon</text><text x=\"159\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Tue</text><text x=\"233\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Wed</text><text x=\"311\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Thu</text><text x=\"391\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Fri</text><text x=\"465\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sat</text><text x=\"539\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sun</text><path d=\"M 96 333\nL 172 331\nL 248 338\nL 324 330\nL 400 340\nL 476 309\nL 552 313\" style=\"stroke-width:2;stroke:rgba(84,112,198,1.0);fill:none\"/><circle cx=\"96\" cy=\"333\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"331\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"338\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"330\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"340\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"309\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"313\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 311\nL 172 320\nL 248 318\nL 324 308\nL 400 295\nL 476 286\nL 552 291\" style=\"stroke-width:2;stroke:rgba(145,204,117,1.0);fill:none\"/><circle cx=\"96\" cy=\"311\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"320\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"295\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"291\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 327\nL 172 308\nL 248 315\nL 324 326\nL 400 318\nL 476 286\nL 552 268\" style=\"stroke-width:2;stroke:rgba(250,200,88,1.0);fill:none\"/><circle cx=\"96\" cy=\"327\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"315\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"326\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"268\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 288\nL 172 286\nL 248 293\nL 324 285\nL 400 273\nL 476 286\nL 552 288\" style=\"stroke-width:2;stroke:rgba(238,102,102,1.0);fill:none\"/><circle cx=\"96\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"293\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"285\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"273\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 176\nL 172 151\nL 248 158\nL 324 150\nL 400 70\nL 476 61\nL 552 63\" style=\"stroke-width:2;stroke:rgba(115,192,222,1.0);fill:none\"/><circle cx=\"96\" cy=\"176\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"151\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"158\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"150\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"70\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"61\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"63\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(255,255,255,1.0)\"/></svg>", svg)
}
func TestThemeDark(t *testing.T) {
t.Parallel()
svg := renderTestLineChartWithThemeName(t, true, ThemeDark)
assertEqualSVG(t, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\">\\n<path d=\"M 0 0\nL 600 0\nL 600 400\nL 0 400\nL 0 0\" style=\"stroke-width:0;stroke:none;fill:rgba(40,40,40,1.0)\"/><path d=\"M 20 19\nL 50 19\" style=\"stroke-width:3;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><circle cx=\"35\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><text x=\"52\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Email</text><path d=\"M 111 19\nL 141 19\" style=\"stroke-width:3;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><circle cx=\"126\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><text x=\"143\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Union Ads</text><path d=\"M 234 19\nL 264 19\" style=\"stroke-width:3;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><circle cx=\"249\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><text x=\"266\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Video Ads</text><path d=\"M 357 19\nL 387 19\" style=\"stroke-width:3;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><circle cx=\"372\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><text x=\"389\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Direct</text><path d=\"M 450 19\nL 480 19\" style=\"stroke-width:3;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><circle cx=\"465\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><text x=\"482\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Search Engine</text><text x=\"10\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Line</text><text x=\"19\" y=\"52\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">1.4k</text><text x=\"22\" y=\"209\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">700</text><text x=\"40\" y=\"367\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">0</text><path d=\"M 59 45\nL 590 45\" style=\"stroke-width:1;stroke:rgba(72,71,83,1.0);fill:none\"/><path d=\"M 59 123\nL 590 123\" style=\"stroke-width:1;stroke:rgba(72,71,83,1.0);fill:none\"/><path d=\"M 59 202\nL 590 202\" style=\"stroke-width:1;stroke:rgba(72,71,83,1.0);fill:none\"/><path d=\"M 59 281\nL 590 281\" style=\"stroke-width:1;stroke:rgba(72,71,83,1.0);fill:none\"/><path d=\"M 59 365\nL 59 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 134 365\nL 134 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 210 365\nL 210 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 286 365\nL 286 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 362 365\nL 362 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 438 365\nL 438 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 514 365\nL 514 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 590 365\nL 590 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 59 360\nL 590 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><text x=\"81\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Mon</text><text x=\"159\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Tue</text><text x=\"233\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Wed</text><text x=\"311\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Thu</text><text x=\"391\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Fri</text><text x=\"465\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sat</text><text x=\"539\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sun</text><path d=\"M 96 333\nL 172 331\nL 248 338\nL 324 330\nL 400 340\nL 476 309\nL 552 313\" style=\"stroke-width:2;stroke:rgba(84,112,198,1.0);fill:none\"/><circle cx=\"96\" cy=\"333\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><circle cx=\"172\" cy=\"331\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><circle cx=\"248\" cy=\"338\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><circle cx=\"324\" cy=\"330\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><circle cx=\"400\" cy=\"340\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><circle cx=\"476\" cy=\"309\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><circle cx=\"552\" cy=\"313\" r=\"2\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(84,112,198,1.0);fill:rgba(84,112,198,1.0)\"/><path d=\"M 96 311\nL 172 320\nL 248 318\nL 324 308\nL 400 295\nL 476 286\nL 552 291\" style=\"stroke-width:2;stroke:rgba(145,204,117,1.0);fill:none\"/><circle cx=\"96\" cy=\"311\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><circle cx=\"172\" cy=\"320\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><circle cx=\"248\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><circle cx=\"324\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><circle cx=\"400\" cy=\"295\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><circle cx=\"552\" cy=\"291\" r=\"2\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(145,204,117,1.0);fill:rgba(145,204,117,1.0)\"/><path d=\"M 96 327\nL 172 308\nL 248 315\nL 324 326\nL 400 318\nL 476 286\nL 552 268\" style=\"stroke-width:2;stroke:rgba(250,200,88,1.0);fill:none\"/><circle cx=\"96\" cy=\"327\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><circle cx=\"172\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><circle cx=\"248\" cy=\"315\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><circle cx=\"324\" cy=\"326\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><circle cx=\"400\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><circle cx=\"552\" cy=\"268\" r=\"2\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(250,200,88,1.0);fill:rgba(250,200,88,1.0)\"/><path d=\"M 96 288\nL 172 286\nL 248 293\nL 324 285\nL 400 273\nL 476 286\nL 552 288\" style=\"stroke-width:2;stroke:rgba(238,102,102,1.0);fill:none\"/><circle cx=\"96\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><circle cx=\"172\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><circle cx=\"248\" cy=\"293\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><circle cx=\"324\" cy=\"285\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><circle cx=\"400\" cy=\"273\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><circle cx=\"552\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(238,102,102,1.0);fill:rgba(238,102,102,1.0)\"/><path d=\"M 96 176\nL 172 151\nL 248 158\nL 324 150\nL 400 70\nL 476 61\nL 552 63\" style=\"stroke-width:2;stroke:rgba(115,192,222,1.0);fill:none\"/><circle cx=\"96\" cy=\"176\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><circle cx=\"172\" cy=\"151\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><circle cx=\"248\" cy=\"158\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><circle cx=\"324\" cy=\"150\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><circle cx=\"400\" cy=\"70\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><circle cx=\"476\" cy=\"61\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><circle cx=\"552\" cy=\"63\" r=\"2\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(115,192,222,1.0);fill:rgba(115,192,222,1.0)\"/></svg>", svg)
}
func TestThemeVividLight(t *testing.T) {
t.Parallel()
svg := renderTestLineChartWithThemeName(t, true, ThemeVividLight)
assertEqualSVG(t, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\">\\n<path d=\"M 0 0\nL 600 0\nL 600 400\nL 0 400\nL 0 0\" style=\"stroke-width:0;stroke:none;fill:rgba(255,255,255,1.0)\"/><path d=\"M 20 19\nL 50 19\" style=\"stroke-width:3;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><circle cx=\"35\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><text x=\"52\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Email</text><path d=\"M 111 19\nL 141 19\" style=\"stroke-width:3;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><circle cx=\"126\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><text x=\"143\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Union Ads</text><path d=\"M 234 19\nL 264 19\" style=\"stroke-width:3;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><circle cx=\"249\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><text x=\"266\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Video Ads</text><path d=\"M 357 19\nL 387 19\" style=\"stroke-width:3;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><circle cx=\"372\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><text x=\"389\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Direct</text><path d=\"M 450 19\nL 480 19\" style=\"stroke-width:3;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><circle cx=\"465\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><text x=\"482\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Search Engine</text><text x=\"10\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Line</text><text x=\"19\" y=\"52\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">1.4k</text><text x=\"22\" y=\"209\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">700</text><text x=\"40\" y=\"367\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">0</text><path d=\"M 59 45\nL 590 45\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 123\nL 590 123\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 202\nL 590 202\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 281\nL 590 281\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 365\nL 59 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 134 365\nL 134 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 210 365\nL 210 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 286 365\nL 286 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 362 365\nL 362 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 438 365\nL 438 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 514 365\nL 514 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 590 365\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 59 360\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><text x=\"81\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Mon</text><text x=\"159\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Tue</text><text x=\"233\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Wed</text><text x=\"311\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Thu</text><text x=\"391\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Fri</text><text x=\"465\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sat</text><text x=\"539\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sun</text><path d=\"M 96 333\nL 172 331\nL 248 338\nL 324 330\nL 400 340\nL 476 309\nL 552 313\" style=\"stroke-width:2;stroke:rgba(255,100,100,1.0);fill:none\"/><circle cx=\"96\" cy=\"333\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"331\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"338\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"330\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"340\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"309\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"313\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 311\nL 172 320\nL 248 318\nL 324 308\nL 400 295\nL 476 286\nL 552 291\" style=\"stroke-width:2;stroke:rgba(255,210,100,1.0);fill:none\"/><circle cx=\"96\" cy=\"311\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"320\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"295\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"291\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 327\nL 172 308\nL 248 315\nL 324 326\nL 400 318\nL 476 286\nL 552 268\" style=\"stroke-width:2;stroke:rgba(100,180,210,1.0);fill:none\"/><circle cx=\"96\" cy=\"327\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"315\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"326\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"268\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 288\nL 172 286\nL 248 293\nL 324 285\nL 400 273\nL 476 286\nL 552 288\" style=\"stroke-width:2;stroke:rgba(64,160,110,1.0);fill:none\"/><circle cx=\"96\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"293\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"285\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"273\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 176\nL 172 151\nL 248 158\nL 324 150\nL 400 70\nL 476 61\nL 552 63\" style=\"stroke-width:2;stroke:rgba(154,100,180,1.0);fill:none\"/><circle cx=\"96\" cy=\"176\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"151\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"158\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"150\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"70\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"61\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"63\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(255,255,255,1.0)\"/></svg>", svg)
}
func TestThemeVividDark(t *testing.T) {
t.Parallel()
svg := renderTestLineChartWithThemeName(t, true, ThemeVividDark)
assertEqualSVG(t, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\">\\n<path d=\"M 0 0\nL 600 0\nL 600 400\nL 0 400\nL 0 0\" style=\"stroke-width:0;stroke:none;fill:rgba(40,40,40,1.0)\"/><path d=\"M 20 19\nL 50 19\" style=\"stroke-width:3;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><circle cx=\"35\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><text x=\"52\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Email</text><path d=\"M 111 19\nL 141 19\" style=\"stroke-width:3;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><circle cx=\"126\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><text x=\"143\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Union Ads</text><path d=\"M 234 19\nL 264 19\" style=\"stroke-width:3;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><circle cx=\"249\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><text x=\"266\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Video Ads</text><path d=\"M 357 19\nL 387 19\" style=\"stroke-width:3;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><circle cx=\"372\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><text x=\"389\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Direct</text><path d=\"M 450 19\nL 480 19\" style=\"stroke-width:3;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><circle cx=\"465\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><text x=\"482\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Search Engine</text><text x=\"10\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Line</text><text x=\"19\" y=\"52\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">1.4k</text><text x=\"22\" y=\"209\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">700</text><text x=\"40\" y=\"367\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">0</text><path d=\"M 59 45\nL 590 45\" style=\"stroke-width:1;stroke:rgba(72,71,83,1.0);fill:none\"/><path d=\"M 59 123\nL 590 123\" style=\"stroke-width:1;stroke:rgba(72,71,83,1.0);fill:none\"/><path d=\"M 59 202\nL 590 202\" style=\"stroke-width:1;stroke:rgba(72,71,83,1.0);fill:none\"/><path d=\"M 59 281\nL 590 281\" style=\"stroke-width:1;stroke:rgba(72,71,83,1.0);fill:none\"/><path d=\"M 59 365\nL 59 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 134 365\nL 134 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 210 365\nL 210 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 286 365\nL 286 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 362 365\nL 362 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 438 365\nL 438 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 514 365\nL 514 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 590 365\nL 590 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 59 360\nL 590 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><text x=\"81\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Mon</text><text x=\"159\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Tue</text><text x=\"233\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Wed</text><text x=\"311\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Thu</text><text x=\"391\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Fri</text><text x=\"465\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sat</text><text x=\"539\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(238,238,238,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sun</text><path d=\"M 96 333\nL 172 331\nL 248 338\nL 324 330\nL 400 340\nL 476 309\nL 552 313\" style=\"stroke-width:2;stroke:rgba(255,100,100,1.0);fill:none\"/><circle cx=\"96\" cy=\"333\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><circle cx=\"172\" cy=\"331\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><circle cx=\"248\" cy=\"338\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><circle cx=\"324\" cy=\"330\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><circle cx=\"400\" cy=\"340\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><circle cx=\"476\" cy=\"309\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><circle cx=\"552\" cy=\"313\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(255,100,100,1.0);fill:rgba(255,100,100,1.0)\"/><path d=\"M 96 311\nL 172 320\nL 248 318\nL 324 308\nL 400 295\nL 476 286\nL 552 291\" style=\"stroke-width:2;stroke:rgba(255,210,100,1.0);fill:none\"/><circle cx=\"96\" cy=\"311\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><circle cx=\"172\" cy=\"320\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><circle cx=\"248\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><circle cx=\"324\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><circle cx=\"400\" cy=\"295\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><circle cx=\"552\" cy=\"291\" r=\"2\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(255,210,100,1.0);fill:rgba(255,210,100,1.0)\"/><path d=\"M 96 327\nL 172 308\nL 248 315\nL 324 326\nL 400 318\nL 476 286\nL 552 268\" style=\"stroke-width:2;stroke:rgba(100,180,210,1.0);fill:none\"/><circle cx=\"96\" cy=\"327\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><circle cx=\"172\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><circle cx=\"248\" cy=\"315\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><circle cx=\"324\" cy=\"326\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><circle cx=\"400\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><circle cx=\"552\" cy=\"268\" r=\"2\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(100,180,210,1.0);fill:rgba(100,180,210,1.0)\"/><path d=\"M 96 288\nL 172 286\nL 248 293\nL 324 285\nL 400 273\nL 476 286\nL 552 288\" style=\"stroke-width:2;stroke:rgba(64,160,110,1.0);fill:none\"/><circle cx=\"96\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><circle cx=\"172\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><circle cx=\"248\" cy=\"293\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><circle cx=\"324\" cy=\"285\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><circle cx=\"400\" cy=\"273\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><circle cx=\"552\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(64,160,110,1.0);fill:rgba(64,160,110,1.0)\"/><path d=\"M 96 176\nL 172 151\nL 248 158\nL 324 150\nL 400 70\nL 476 61\nL 552 63\" style=\"stroke-width:2;stroke:rgba(154,100,180,1.0);fill:none\"/><circle cx=\"96\" cy=\"176\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><circle cx=\"172\" cy=\"151\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><circle cx=\"248\" cy=\"158\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><circle cx=\"324\" cy=\"150\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><circle cx=\"400\" cy=\"70\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><circle cx=\"476\" cy=\"61\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><circle cx=\"552\" cy=\"63\" r=\"2\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(154,100,180,1.0);fill:rgba(154,100,180,1.0)\"/></svg>", svg)
}
func TestThemeAnt(t *testing.T) {
t.Parallel()
svg := renderTestLineChartWithThemeName(t, true, ThemeAnt)
assertEqualSVG(t, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\">\\n<path d=\"M 0 0\nL 600 0\nL 600 400\nL 0 400\nL 0 0\" style=\"stroke-width:0;stroke:none;fill:rgba(255,255,255,1.0)\"/><path d=\"M 20 19\nL 50 19\" style=\"stroke-width:3;stroke:rgba(91,143,249,1.0);fill:rgba(91,143,249,1.0)\"/><circle cx=\"35\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(91,143,249,1.0);fill:rgba(91,143,249,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(91,143,249,1.0);fill:rgba(91,143,249,1.0)\"/><text x=\"52\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Email</text><path d=\"M 111 19\nL 141 19\" style=\"stroke-width:3;stroke:rgba(90,216,166,1.0);fill:rgba(90,216,166,1.0)\"/><circle cx=\"126\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(90,216,166,1.0);fill:rgba(90,216,166,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(90,216,166,1.0);fill:rgba(90,216,166,1.0)\"/><text x=\"143\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Union Ads</text><path d=\"M 234 19\nL 264 19\" style=\"stroke-width:3;stroke:rgba(93,112,146,1.0);fill:rgba(93,112,146,1.0)\"/><circle cx=\"249\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(93,112,146,1.0);fill:rgba(93,112,146,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(93,112,146,1.0);fill:rgba(93,112,146,1.0)\"/><text x=\"266\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Video Ads</text><path d=\"M 357 19\nL 387 19\" style=\"stroke-width:3;stroke:rgba(246,189,22,1.0);fill:rgba(246,189,22,1.0)\"/><circle cx=\"372\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(246,189,22,1.0);fill:rgba(246,189,22,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(246,189,22,1.0);fill:rgba(246,189,22,1.0)\"/><text x=\"389\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Direct</text><path d=\"M 450 19\nL 480 19\" style=\"stroke-width:3;stroke:rgba(111,94,249,1.0);fill:rgba(111,94,249,1.0)\"/><circle cx=\"465\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(111,94,249,1.0);fill:rgba(111,94,249,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(111,94,249,1.0);fill:rgba(111,94,249,1.0)\"/><text x=\"482\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Search Engine</text><text x=\"10\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Line</text><text x=\"19\" y=\"52\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">1.4k</text><text x=\"22\" y=\"209\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">700</text><text x=\"40\" y=\"367\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">0</text><path d=\"M 59 45\nL 590 45\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 123\nL 590 123\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 202\nL 590 202\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 281\nL 590 281\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 365\nL 59 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 134 365\nL 134 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 210 365\nL 210 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 286 365\nL 286 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 362 365\nL 362 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 438 365\nL 438 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 514 365\nL 514 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 590 365\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 59 360\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><text x=\"81\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Mon</text><text x=\"159\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Tue</text><text x=\"233\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Wed</text><text x=\"311\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Thu</text><text x=\"391\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Fri</text><text x=\"465\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sat</text><text x=\"539\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sun</text><path d=\"M 96 333\nL 172 331\nL 248 338\nL 324 330\nL 400 340\nL 476 309\nL 552 313\" style=\"stroke-width:2;stroke:rgba(91,143,249,1.0);fill:none\"/><circle cx=\"96\" cy=\"333\" r=\"2\" style=\"stroke-width:1;stroke:rgba(91,143,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"331\" r=\"2\" style=\"stroke-width:1;stroke:rgba(91,143,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"338\" r=\"2\" style=\"stroke-width:1;stroke:rgba(91,143,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"330\" r=\"2\" style=\"stroke-width:1;stroke:rgba(91,143,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"340\" r=\"2\" style=\"stroke-width:1;stroke:rgba(91,143,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"309\" r=\"2\" style=\"stroke-width:1;stroke:rgba(91,143,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"313\" r=\"2\" style=\"stroke-width:1;stroke:rgba(91,143,249,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(91,143,249,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 311\nL 172 320\nL 248 318\nL 324 308\nL 400 295\nL 476 286\nL 552 291\" style=\"stroke-width:2;stroke:rgba(90,216,166,1.0);fill:none\"/><circle cx=\"96\" cy=\"311\" r=\"2\" style=\"stroke-width:1;stroke:rgba(90,216,166,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"320\" r=\"2\" style=\"stroke-width:1;stroke:rgba(90,216,166,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(90,216,166,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(90,216,166,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"295\" r=\"2\" style=\"stroke-width:1;stroke:rgba(90,216,166,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(90,216,166,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"291\" r=\"2\" style=\"stroke-width:1;stroke:rgba(90,216,166,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(90,216,166,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 327\nL 172 308\nL 248 315\nL 324 326\nL 400 318\nL 476 286\nL 552 268\" style=\"stroke-width:2;stroke:rgba(93,112,146,1.0);fill:none\"/><circle cx=\"96\" cy=\"327\" r=\"2\" style=\"stroke-width:1;stroke:rgba(93,112,146,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(93,112,146,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"315\" r=\"2\" style=\"stroke-width:1;stroke:rgba(93,112,146,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"326\" r=\"2\" style=\"stroke-width:1;stroke:rgba(93,112,146,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(93,112,146,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(93,112,146,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"268\" r=\"2\" style=\"stroke-width:1;stroke:rgba(93,112,146,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(93,112,146,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 288\nL 172 286\nL 248 293\nL 324 285\nL 400 273\nL 476 286\nL 552 288\" style=\"stroke-width:2;stroke:rgba(246,189,22,1.0);fill:none\"/><circle cx=\"96\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(246,189,22,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(246,189,22,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"293\" r=\"2\" style=\"stroke-width:1;stroke:rgba(246,189,22,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"285\" r=\"2\" style=\"stroke-width:1;stroke:rgba(246,189,22,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"273\" r=\"2\" style=\"stroke-width:1;stroke:rgba(246,189,22,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(246,189,22,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(246,189,22,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(246,189,22,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"M 96 176\nL 172 151\nL 248 158\nL 324 150\nL 400 70\nL 476 61\nL 552 63\" style=\"stroke-width:2;stroke:rgba(111,94,249,1.0);fill:none\"/><circle cx=\"96\" cy=\"176\" r=\"2\" style=\"stroke-width:1;stroke:rgba(111,94,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"172\" cy=\"151\" r=\"2\" style=\"stroke-width:1;stroke:rgba(111,94,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"248\" cy=\"158\" r=\"2\" style=\"stroke-width:1;stroke:rgba(111,94,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"324\" cy=\"150\" r=\"2\" style=\"stroke-width:1;stroke:rgba(111,94,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"400\" cy=\"70\" r=\"2\" style=\"stroke-width:1;stroke:rgba(111,94,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"476\" cy=\"61\" r=\"2\" style=\"stroke-width:1;stroke:rgba(111,94,249,1.0);fill:rgba(255,255,255,1.0)\"/><circle cx=\"552\" cy=\"63\" r=\"2\" style=\"stroke-width:1;stroke:rgba(111,94,249,1.0);fill:rgba(255,255,255,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(111,94,249,1.0);fill:rgba(255,255,255,1.0)\"/></svg>", svg)
}
func TestThemeGrafana(t *testing.T) {
t.Parallel()
svg := renderTestLineChartWithThemeName(t, true, ThemeGrafana)
assertEqualSVG(t, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\">\\n<path d=\"M 0 0\nL 600 0\nL 600 400\nL 0 400\nL 0 0\" style=\"stroke-width:0;stroke:none;fill:rgba(31,29,29,1.0)\"/><path d=\"M 20 19\nL 50 19\" style=\"stroke-width:3;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><circle cx=\"35\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><text x=\"52\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Email</text><path d=\"M 111 19\nL 141 19\" style=\"stroke-width:3;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><circle cx=\"126\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><text x=\"143\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Union Ads</text><path d=\"M 234 19\nL 264 19\" style=\"stroke-width:3;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><circle cx=\"249\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><text x=\"266\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Video Ads</text><path d=\"M 357 19\nL 387 19\" style=\"stroke-width:3;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><circle cx=\"372\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><text x=\"389\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Direct</text><path d=\"M 450 19\nL 480 19\" style=\"stroke-width:3;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><circle cx=\"465\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><text x=\"482\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Search Engine</text><text x=\"10\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Line</text><text x=\"19\" y=\"52\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">1.4k</text><text x=\"22\" y=\"209\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">700</text><text x=\"40\" y=\"367\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">0</text><path d=\"M 59 45\nL 590 45\" style=\"stroke-width:1;stroke:rgba(68,67,67,1.0);fill:none\"/><path d=\"M 59 123\nL 590 123\" style=\"stroke-width:1;stroke:rgba(68,67,67,1.0);fill:none\"/><path d=\"M 59 202\nL 590 202\" style=\"stroke-width:1;stroke:rgba(68,67,67,1.0);fill:none\"/><path d=\"M 59 281\nL 590 281\" style=\"stroke-width:1;stroke:rgba(68,67,67,1.0);fill:none\"/><path d=\"M 59 365\nL 59 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 134 365\nL 134 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 210 365\nL 210 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 286 365\nL 286 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 362 365\nL 362 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 438 365\nL 438 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 514 365\nL 514 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 590 365\nL 590 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><path d=\"M 59 360\nL 590 360\" style=\"stroke-width:1;stroke:rgba(185,184,206,1.0);fill:none\"/><text x=\"81\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Mon</text><text x=\"159\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Tue</text><text x=\"233\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Wed</text><text x=\"311\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Thu</text><text x=\"391\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Fri</text><text x=\"465\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sat</text><text x=\"539\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(216,217,218,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sun</text><path d=\"M 96 333\nL 172 331\nL 248 338\nL 324 330\nL 400 340\nL 476 309\nL 552 313\" style=\"stroke-width:2;stroke:rgba(126,178,109,1.0);fill:none\"/><circle cx=\"96\" cy=\"333\" r=\"2\" style=\"stroke-width:1;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><circle cx=\"172\" cy=\"331\" r=\"2\" style=\"stroke-width:1;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><circle cx=\"248\" cy=\"338\" r=\"2\" style=\"stroke-width:1;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><circle cx=\"324\" cy=\"330\" r=\"2\" style=\"stroke-width:1;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><circle cx=\"400\" cy=\"340\" r=\"2\" style=\"stroke-width:1;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><circle cx=\"476\" cy=\"309\" r=\"2\" style=\"stroke-width:1;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><circle cx=\"552\" cy=\"313\" r=\"2\" style=\"stroke-width:1;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(126,178,109,1.0);fill:rgba(126,178,109,1.0)\"/><path d=\"M 96 311\nL 172 320\nL 248 318\nL 324 308\nL 400 295\nL 476 286\nL 552 291\" style=\"stroke-width:2;stroke:rgba(234,184,57,1.0);fill:none\"/><circle cx=\"96\" cy=\"311\" r=\"2\" style=\"stroke-width:1;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><circle cx=\"172\" cy=\"320\" r=\"2\" style=\"stroke-width:1;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><circle cx=\"248\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><circle cx=\"324\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><circle cx=\"400\" cy=\"295\" r=\"2\" style=\"stroke-width:1;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><circle cx=\"552\" cy=\"291\" r=\"2\" style=\"stroke-width:1;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(234,184,57,1.0);fill:rgba(234,184,57,1.0)\"/><path d=\"M 96 327\nL 172 308\nL 248 315\nL 324 326\nL 400 318\nL 476 286\nL 552 268\" style=\"stroke-width:2;stroke:rgba(110,208,224,1.0);fill:none\"/><circle cx=\"96\" cy=\"327\" r=\"2\" style=\"stroke-width:1;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><circle cx=\"172\" cy=\"308\" r=\"2\" style=\"stroke-width:1;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><circle cx=\"248\" cy=\"315\" r=\"2\" style=\"stroke-width:1;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><circle cx=\"324\" cy=\"326\" r=\"2\" style=\"stroke-width:1;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><circle cx=\"400\" cy=\"318\" r=\"2\" style=\"stroke-width:1;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><circle cx=\"552\" cy=\"268\" r=\"2\" style=\"stroke-width:1;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(110,208,224,1.0);fill:rgba(110,208,224,1.0)\"/><path d=\"M 96 288\nL 172 286\nL 248 293\nL 324 285\nL 400 273\nL 476 286\nL 552 288\" style=\"stroke-width:2;stroke:rgba(239,132,60,1.0);fill:none\"/><circle cx=\"96\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><circle cx=\"172\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><circle cx=\"248\" cy=\"293\" r=\"2\" style=\"stroke-width:1;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><circle cx=\"324\" cy=\"285\" r=\"2\" style=\"stroke-width:1;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><circle cx=\"400\" cy=\"273\" r=\"2\" style=\"stroke-width:1;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><circle cx=\"476\" cy=\"286\" r=\"2\" style=\"stroke-width:1;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><circle cx=\"552\" cy=\"288\" r=\"2\" style=\"stroke-width:1;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(239,132,60,1.0);fill:rgba(239,132,60,1.0)\"/><path d=\"M 96 176\nL 172 151\nL 248 158\nL 324 150\nL 400 70\nL 476 61\nL 552 63\" style=\"stroke-width:2;stroke:rgba(226,77,66,1.0);fill:none\"/><circle cx=\"96\" cy=\"176\" r=\"2\" style=\"stroke-width:1;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><circle cx=\"172\" cy=\"151\" r=\"2\" style=\"stroke-width:1;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><circle cx=\"248\" cy=\"158\" r=\"2\" style=\"stroke-width:1;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><circle cx=\"324\" cy=\"150\" r=\"2\" style=\"stroke-width:1;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><circle cx=\"400\" cy=\"70\" r=\"2\" style=\"stroke-width:1;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><circle cx=\"476\" cy=\"61\" r=\"2\" style=\"stroke-width:1;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><circle cx=\"552\" cy=\"63\" r=\"2\" style=\"stroke-width:1;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/><path d=\"\" style=\"stroke-width:1;stroke:rgba(226,77,66,1.0);fill:rgba(226,77,66,1.0)\"/></svg>", svg)
}
func TestLightThemeSeriesRepeat(t *testing.T) {
t.Parallel()
svg := renderTestLineChartWithTheme(t, false,
&themeColorPalette{
name: t.Name(),
isDarkMode: false,
axisStrokeColor: Color{R: 110, G: 112, B: 121, A: 255},
axisSplitLineColor: Color{R: 224, G: 230, B: 242, A: 255},
backgroundColor: drawing.ColorWhite,
textColor: Color{R: 70, G: 70, B: 70, A: 255},
seriesColors: []Color{
{R: 50, G: 50, B: 50, A: 255},
{R: 200, G: 50, B: 50, A: 255},
},
})
assertEqualSVG(t, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\">\\n<path d=\"M 0 0\nL 600 0\nL 600 400\nL 0 400\nL 0 0\" style=\"stroke-width:0;stroke:none;fill:rgba(255,255,255,1.0)\"/><path d=\"M 20 19\nL 50 19\" style=\"stroke-width:3;stroke:rgba(50,50,50,1.0);fill:rgba(50,50,50,1.0)\"/><circle cx=\"35\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(50,50,50,1.0);fill:rgba(50,50,50,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(50,50,50,1.0);fill:rgba(50,50,50,1.0)\"/><text x=\"52\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Email</text><path d=\"M 111 19\nL 141 19\" style=\"stroke-width:3;stroke:rgba(200,50,50,1.0);fill:rgba(200,50,50,1.0)\"/><circle cx=\"126\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(200,50,50,1.0);fill:rgba(200,50,50,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(200,50,50,1.0);fill:rgba(200,50,50,1.0)\"/><text x=\"143\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Union Ads</text><path d=\"M 234 19\nL 264 19\" style=\"stroke-width:3;stroke:rgba(90,90,90,1.0);fill:rgba(90,90,90,1.0)\"/><circle cx=\"249\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(90,90,90,1.0);fill:rgba(90,90,90,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(90,90,90,1.0);fill:rgba(90,90,90,1.0)\"/><text x=\"266\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Video Ads</text><path d=\"M 357 19\nL 387 19\" style=\"stroke-width:3;stroke:rgba(200,90,90,1.0);fill:rgba(200,90,90,1.0)\"/><circle cx=\"372\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(200,90,90,1.0);fill:rgba(200,90,90,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(200,90,90,1.0);fill:rgba(200,90,90,1.0)\"/><text x=\"389\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Direct</text><path d=\"M 450 19\nL 480 19\" style=\"stroke-width:3;stroke:rgba(130,130,130,1.0);fill:rgba(130,130,130,1.0)\"/><circle cx=\"465\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(130,130,130,1.0);fill:rgba(130,130,130,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(130,130,130,1.0);fill:rgba(130,130,130,1.0)\"/><text x=\"482\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Search Engine</text><text x=\"19\" y=\"52\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">1.4k</text><text x=\"22\" y=\"209\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">700</text><text x=\"40\" y=\"367\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">0</text><path d=\"M 59 45\nL 590 45\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 123\nL 590 123\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 202\nL 590 202\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 281\nL 590 281\" style=\"stroke-width:1;stroke:rgba(224,230,242,1.0);fill:none\"/><path d=\"M 59 365\nL 59 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 134 365\nL 134 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 210 365\nL 210 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 286 365\nL 286 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 362 365\nL 362 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 438 365\nL 438 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 514 365\nL 514 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 590 365\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 59 360\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><text x=\"81\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Mon</text><text x=\"159\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Tue</text><text x=\"233\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Wed</text><text x=\"311\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Thu</text><text x=\"391\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Fri</text><text x=\"465\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sat</text><text x=\"539\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sun</text><path d=\"M 96 333\nL 172 331\nL 248 338\nL 324 330\nL 400 340\nL 476 309\nL 552 313\" style=\"stroke-width:2;stroke:rgba(50,50,50,1.0);fill:none\"/><path d=\"M 96 311\nL 172 320\nL 248 318\nL 324 308\nL 400 295\nL 476 286\nL 552 291\" style=\"stroke-width:2;stroke:rgba(200,50,50,1.0);fill:none\"/><path d=\"M 96 327\nL 172 308\nL 248 315\nL 324 326\nL 400 318\nL 476 286\nL 552 268\" style=\"stroke-width:2;stroke:rgba(90,90,90,1.0);fill:none\"/><path d=\"M 96 288\nL 172 286\nL 248 293\nL 324 285\nL 400 273\nL 476 286\nL 552 288\" style=\"stroke-width:2;stroke:rgba(200,90,90,1.0);fill:none\"/><path d=\"M 96 176\nL 172 151\nL 248 158\nL 324 150\nL 400 70\nL 476 61\nL 552 63\" style=\"stroke-width:2;stroke:rgba(130,130,130,1.0);fill:none\"/></svg>", svg)
}
func TestDarkThemeSeriesRepeat(t *testing.T) {
t.Parallel()
svg := renderTestLineChartWithTheme(t, false,
&themeColorPalette{
name: t.Name(),
isDarkMode: true,
axisStrokeColor: Color{R: 110, G: 112, B: 121, A: 255},
axisSplitLineColor: Color{R: 40, G: 40, B: 60, A: 255},
backgroundColor: Color{R: 40, G: 40, B: 60, A: 255},
textColor: Color{R: 70, G: 70, B: 70, A: 255},
seriesColors: []Color{
{R: 250, G: 250, B: 250, A: 255},
{R: 200, G: 50, B: 50, A: 255},
},
})
assertEqualSVG(t, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\">\\n<path d=\"M 0 0\nL 600 0\nL 600 400\nL 0 400\nL 0 0\" style=\"stroke-width:0;stroke:none;fill:rgba(40,40,60,1.0)\"/><path d=\"M 20 19\nL 50 19\" style=\"stroke-width:3;stroke:rgba(250,250,250,1.0);fill:rgba(250,250,250,1.0)\"/><circle cx=\"35\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(250,250,250,1.0);fill:rgba(250,250,250,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(250,250,250,1.0);fill:rgba(250,250,250,1.0)\"/><text x=\"52\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Email</text><path d=\"M 111 19\nL 141 19\" style=\"stroke-width:3;stroke:rgba(200,50,50,1.0);fill:rgba(200,50,50,1.0)\"/><circle cx=\"126\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(200,50,50,1.0);fill:rgba(200,50,50,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(200,50,50,1.0);fill:rgba(200,50,50,1.0)\"/><text x=\"143\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Union Ads</text><path d=\"M 234 19\nL 264 19\" style=\"stroke-width:3;stroke:rgba(210,210,210,1.0);fill:rgba(210,210,210,1.0)\"/><circle cx=\"249\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(210,210,210,1.0);fill:rgba(210,210,210,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(210,210,210,1.0);fill:rgba(210,210,210,1.0)\"/><text x=\"266\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Video Ads</text><path d=\"M 357 19\nL 387 19\" style=\"stroke-width:3;stroke:rgba(160,40,40,1.0);fill:rgba(160,40,40,1.0)\"/><circle cx=\"372\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(160,40,40,1.0);fill:rgba(160,40,40,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(160,40,40,1.0);fill:rgba(160,40,40,1.0)\"/><text x=\"389\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Direct</text><path d=\"M 450 19\nL 480 19\" style=\"stroke-width:3;stroke:rgba(170,170,170,1.0);fill:rgba(170,170,170,1.0)\"/><circle cx=\"465\" cy=\"19\" r=\"5\" style=\"stroke-width:3;stroke:rgba(170,170,170,1.0);fill:rgba(170,170,170,1.0)\"/><path d=\"\" style=\"stroke-width:3;stroke:rgba(170,170,170,1.0);fill:rgba(170,170,170,1.0)\"/><text x=\"482\" y=\"25\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Search Engine</text><text x=\"19\" y=\"52\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">1.4k</text><text x=\"22\" y=\"209\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">700</text><text x=\"40\" y=\"367\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">0</text><path d=\"M 59 45\nL 590 45\" style=\"stroke-width:1;stroke:rgba(40,40,60,1.0);fill:none\"/><path d=\"M 59 123\nL 590 123\" style=\"stroke-width:1;stroke:rgba(40,40,60,1.0);fill:none\"/><path d=\"M 59 202\nL 590 202\" style=\"stroke-width:1;stroke:rgba(40,40,60,1.0);fill:none\"/><path d=\"M 59 281\nL 590 281\" style=\"stroke-width:1;stroke:rgba(40,40,60,1.0);fill:none\"/><path d=\"M 59 365\nL 59 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 134 365\nL 134 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 210 365\nL 210 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 286 365\nL 286 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 362 365\nL 362 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 438 365\nL 438 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 514 365\nL 514 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 590 365\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><path d=\"M 59 360\nL 590 360\" style=\"stroke-width:1;stroke:rgba(110,112,121,1.0);fill:none\"/><text x=\"81\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Mon</text><text x=\"159\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Tue</text><text x=\"233\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Wed</text><text x=\"311\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Thu</text><text x=\"391\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Fri</text><text x=\"465\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sat</text><text x=\"539\" y=\"385\" style=\"stroke-width:0;stroke:none;fill:rgba(70,70,70,1.0);font-size:15.3px;font-family:'Roboto Medium',sans-serif\">Sun</text><path d=\"M 96 333\nL 172 331\nL 248 338\nL 324 330\nL 400 340\nL 476 309\nL 552 313\" style=\"stroke-width:2;stroke:rgba(250,250,250,1.0);fill:none\"/><path d=\"M 96 311\nL 172 320\nL 248 318\nL 324 308\nL 400 295\nL 476 286\nL 552 291\" style=\"stroke-width:2;stroke:rgba(200,50,50,1.0);fill:none\"/><path d=\"M 96 327\nL 172 308\nL 248 315\nL 324 326\nL 400 318\nL 476 286\nL 552 268\" style=\"stroke-width:2;stroke:rgba(210,210,210,1.0);fill:none\"/><path d=\"M 96 288\nL 172 286\nL 248 293\nL 324 285\nL 400 273\nL 476 286\nL 552 288\" style=\"stroke-width:2;stroke:rgba(160,40,40,1.0);fill:none\"/><path d=\"M 96 176\nL 172 151\nL 248 158\nL 324 150\nL 400 70\nL 476 61\nL 552 63\" style=\"stroke-width:2;stroke:rgba(170,170,170,1.0);fill:none\"/></svg>", svg)
}
func TestWithAxisColor(t *testing.T) {
t.Parallel()
whiteCP := &themeColorPalette{
name: t.Name(),
isDarkMode: false,
axisSplitLineColor: drawing.ColorWhite,
axisStrokeColor: drawing.ColorWhite,
backgroundColor: drawing.ColorWhite,
textColor: drawing.ColorWhite,
seriesColors: []Color{drawing.ColorWhite},
}
blackCP := whiteCP.WithAxisColor(drawing.ColorBlack)
assert.Equal(t, drawing.ColorWhite, whiteCP.axisSplitLineColor)
assert.Equal(t, drawing.ColorWhite, whiteCP.axisStrokeColor)
assert.Equal(t, drawing.ColorWhite, whiteCP.backgroundColor)
assert.Equal(t, drawing.ColorWhite, whiteCP.textColor)
assert.Equal(t, drawing.ColorWhite, whiteCP.seriesColors[0])
assert.Equal(t, drawing.ColorBlack, blackCP.GetAxisSplitLineColor())
assert.Equal(t, drawing.ColorBlack, blackCP.GetAxisStrokeColor())
assert.Equal(t, drawing.ColorBlack, blackCP.GetTextColor())
assert.Equal(t, drawing.ColorWhite, blackCP.GetBackgroundColor())
assert.Equal(t, drawing.ColorWhite, blackCP.GetSeriesColor(0))
}
func TestWithTextColor(t *testing.T) {
t.Parallel()
whiteCP := &themeColorPalette{
name: t.Name(),
isDarkMode: false,
axisSplitLineColor: drawing.ColorWhite,
axisStrokeColor: drawing.ColorWhite,
backgroundColor: drawing.ColorWhite,
textColor: drawing.ColorWhite,
seriesColors: []Color{drawing.ColorWhite},
}
blackCP := whiteCP.WithTextColor(drawing.ColorBlack)
assert.Equal(t, drawing.ColorWhite, whiteCP.axisSplitLineColor)
assert.Equal(t, drawing.ColorWhite, whiteCP.axisStrokeColor)
assert.Equal(t, drawing.ColorWhite, whiteCP.backgroundColor)
assert.Equal(t, drawing.ColorWhite, whiteCP.textColor)
assert.Equal(t, drawing.ColorWhite, whiteCP.seriesColors[0])
assert.Equal(t, drawing.ColorBlack, blackCP.GetTextColor())
assert.Equal(t, drawing.ColorWhite, blackCP.GetAxisSplitLineColor())
assert.Equal(t, drawing.ColorWhite, blackCP.GetAxisStrokeColor())
assert.Equal(t, drawing.ColorWhite, blackCP.GetBackgroundColor())
assert.Equal(t, drawing.ColorWhite, blackCP.GetSeriesColor(0))
}