@@ -153,7 +153,9 @@ func TestAddChart(t *testing.T) {
153
153
{Name : "Sheet1!$A$37" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$37:$D$37" },
154
154
}
155
155
series2 := []ChartSeries {
156
- {Name : "Sheet1!$A$30" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$30:$D$30" , Marker : ChartMarker {Symbol : "none" , Size : 10 }, Line : ChartLine {Color : "#000000" }},
156
+ {Name : "Sheet1!$A$30" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$30:$D$30" ,
157
+ Fill : Fill {Type : "pattern" , Color : []string {"000000" }, Pattern : 1 },
158
+ Marker : ChartMarker {Symbol : "none" , Size : 10 }},
157
159
{Name : "Sheet1!$A$31" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$31:$D$31" },
158
160
{Name : "Sheet1!$A$32" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$32:$D$32" },
159
161
{Name : "Sheet1!$A$33" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$33:$D$33" },
@@ -163,6 +165,16 @@ func TestAddChart(t *testing.T) {
163
165
{Name : "Sheet1!$A$37" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$37:$D$37" , Line : ChartLine {Width : 0.25 }},
164
166
}
165
167
series3 := []ChartSeries {{Name : "Sheet1!$A$30" , Categories : "Sheet1!$A$30:$D$37" , Values : "Sheet1!$B$30:$B$37" }}
168
+ series4 := []ChartSeries {
169
+ {Name : "Sheet1!$A$30" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$30:$D$30" , Sizes : "Sheet1!$B$30:$D$30" },
170
+ {Name : "Sheet1!$A$31" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$31:$D$31" , Sizes : "Sheet1!$B$31:$D$31" },
171
+ {Name : "Sheet1!$A$32" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$32:$D$32" , Sizes : "Sheet1!$B$32:$D$32" },
172
+ {Name : "Sheet1!$A$33" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$33:$D$33" , Sizes : "Sheet1!$B$33:$D$33" },
173
+ {Name : "Sheet1!$A$34" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$34:$D$34" , Sizes : "Sheet1!$B$34:$D$34" },
174
+ {Name : "Sheet1!$A$35" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$35:$D$35" , Sizes : "Sheet1!$B$35:$D$35" },
175
+ {Name : "Sheet1!$A$36" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$36:$D$36" , Sizes : "Sheet1!$B$36:$D$36" },
176
+ {Name : "Sheet1!$A$37" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$37:$D$37" , Sizes : "Sheet1!$B$37:$D$37" },
177
+ }
166
178
format := GraphicOptions {
167
179
ScaleX : defaultPictureScale ,
168
180
ScaleY : defaultPictureScale ,
@@ -242,8 +254,8 @@ func TestAddChart(t *testing.T) {
242
254
{sheetName : "Sheet2" , cell : "AV32" , opts : & Chart {Type : "contour" , Series : series , Format : format , Legend : legend , Title : ChartTitle {Name : "Contour Chart" }, PlotArea : plotArea , ShowBlanksAs : "zero" }},
243
255
{sheetName : "Sheet2" , cell : "BD1" , opts : & Chart {Type : "wireframeContour" , Series : series , Format : format , Legend : legend , Title : ChartTitle {Name : "Wireframe Contour Chart" }, PlotArea : plotArea , ShowBlanksAs : "zero" }},
244
256
// bubble chart
245
- {sheetName : "Sheet2" , cell : "BD16" , opts : & Chart {Type : "bubble" , Series : series , Format : format , Legend : legend , Title : ChartTitle {Name : "Bubble Chart" }, PlotArea : plotArea , ShowBlanksAs : "zero" }},
246
- {sheetName : "Sheet2" , cell : "BD32" , opts : & Chart {Type : "bubble3D" , Series : series , Format : format , Legend : legend , Title : ChartTitle {Name : "Bubble 3D Chart" }, PlotArea : plotArea , ShowBlanksAs : "zero" , XAxis : ChartAxis {MajorGridLines : true }, YAxis : ChartAxis {MajorGridLines : true }}},
257
+ {sheetName : "Sheet2" , cell : "BD16" , opts : & Chart {Type : "bubble" , Series : series4 , Format : format , Legend : legend , Title : ChartTitle {Name : "Bubble Chart" }, PlotArea : plotArea , ShowBlanksAs : "zero" }},
258
+ {sheetName : "Sheet2" , cell : "BD32" , opts : & Chart {Type : "bubble3D" , Series : series4 , Format : format , Legend : legend , Title : ChartTitle {Name : "Bubble 3D Chart" }, PlotArea : plotArea , ShowBlanksAs : "zero" , XAxis : ChartAxis {MajorGridLines : true }, YAxis : ChartAxis {MajorGridLines : true }}},
247
259
// pie of pie chart
248
260
{sheetName : "Sheet2" , cell : "BD48" , opts : & Chart {Type : "pieOfPie" , Series : series3 , Format : format , Legend : legend , Title : ChartTitle {Name : "Pie of Pie Chart" }, PlotArea : plotArea , ShowBlanksAs : "zero" , XAxis : ChartAxis {MajorGridLines : true }, YAxis : ChartAxis {MajorGridLines : true }}},
249
261
// bar of pie chart
@@ -256,18 +268,14 @@ func TestAddChart(t *testing.T) {
256
268
assert .NoError (t , err )
257
269
clusteredColumnCombo := [][]string {
258
270
{"A1" , "line" , "Clustered Column - Line Chart" },
259
- {"I1" , "bubble" , "Clustered Column - Bubble Chart" },
260
- {"Q1" , "bubble3D" , "Clustered Column - Bubble 3D Chart" },
261
- {"Y1" , "doughnut" , "Clustered Column - Doughnut Chart" },
271
+ {"I1" , "doughnut" , "Clustered Column - Doughnut Chart" },
262
272
}
263
273
for _ , props := range clusteredColumnCombo {
264
274
assert .NoError (t , f .AddChart ("Combo Charts" , props [0 ], & Chart {Type : "col" , Series : series [:4 ], Format : format , Legend : legend , Title : ChartTitle {Name : props [2 ]}, PlotArea : ChartPlotArea {ShowBubbleSize : true , ShowCatName : false , ShowLeaderLines : false , ShowPercent : true , ShowSerName : true , ShowVal : true }}, & Chart {Type : props [1 ], Series : series [4 :], Format : format , Legend : legend , PlotArea : ChartPlotArea {ShowBubbleSize : true , ShowCatName : false , ShowLeaderLines : false , ShowPercent : true , ShowSerName : true , ShowVal : true }}))
265
275
}
266
276
stackedAreaCombo := map [string ][]string {
267
277
"A16" : {"line" , "Stacked Area - Line Chart" },
268
- "I16" : {"bubble" , "Stacked Area - Bubble Chart" },
269
- "Q16" : {"bubble3D" , "Stacked Area - Bubble 3D Chart" },
270
- "Y16" : {"doughnut" , "Stacked Area - Doughnut Chart" },
278
+ "I16" : {"doughnut" , "Stacked Area - Doughnut Chart" },
271
279
}
272
280
for axis , props := range stackedAreaCombo {
273
281
assert .NoError (t , f .AddChart ("Combo Charts" , axis , & Chart {Type : "areaStacked" , Series : series [:4 ], Format : format , Legend : legend , Title : ChartTitle {Name : props [1 ]}, PlotArea : ChartPlotArea {ShowBubbleSize : true , ShowCatName : false , ShowLeaderLines : false , ShowPercent : true , ShowSerName : true , ShowVal : true }}, & Chart {Type : props [0 ], Series : series [4 :], Format : format , Legend : legend , PlotArea : ChartPlotArea {ShowBubbleSize : true , ShowCatName : false , ShowLeaderLines : false , ShowPercent : true , ShowSerName : true , ShowVal : true }}))
0 commit comments