@ -153,7 +153,9 @@ func TestAddChart(t *testing.T) {
{ Name : "Sheet1!$A$37" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$37:$D$37" } ,
}
series2 := [ ] ChartSeries {
{ 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" } } ,
{ Name : "Sheet1!$A$30" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$30:$D$30" ,
Fill : Fill { Type : "pattern" , Color : [ ] string { "000000" } , Pattern : 1 } ,
Marker : ChartMarker { Symbol : "none" , Size : 10 } } ,
{ Name : "Sheet1!$A$31" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$31:$D$31" } ,
{ Name : "Sheet1!$A$32" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$32:$D$32" } ,
{ 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) {
{ Name : "Sheet1!$A$37" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$37:$D$37" , Line : ChartLine { Width : 0.25 } } ,
}
series3 := [ ] ChartSeries { { Name : "Sheet1!$A$30" , Categories : "Sheet1!$A$30:$D$37" , Values : "Sheet1!$B$30:$B$37" } }
series4 := [ ] ChartSeries {
{ Name : "Sheet1!$A$30" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$30:$D$30" , Sizes : "Sheet1!$B$30:$D$30" } ,
{ Name : "Sheet1!$A$31" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$31:$D$31" , Sizes : "Sheet1!$B$31:$D$31" } ,
{ Name : "Sheet1!$A$32" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$32:$D$32" , Sizes : "Sheet1!$B$32:$D$32" } ,
{ Name : "Sheet1!$A$33" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$33:$D$33" , Sizes : "Sheet1!$B$33:$D$33" } ,
{ Name : "Sheet1!$A$34" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$34:$D$34" , Sizes : "Sheet1!$B$34:$D$34" } ,
{ Name : "Sheet1!$A$35" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$35:$D$35" , Sizes : "Sheet1!$B$35:$D$35" } ,
{ Name : "Sheet1!$A$36" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$36:$D$36" , Sizes : "Sheet1!$B$36:$D$36" } ,
{ Name : "Sheet1!$A$37" , Categories : "Sheet1!$B$29:$D$29" , Values : "Sheet1!$B$37:$D$37" , Sizes : "Sheet1!$B$37:$D$37" } ,
}
format := GraphicOptions {
ScaleX : defaultPictureScale ,
ScaleY : defaultPictureScale ,
@ -242,8 +254,8 @@ func TestAddChart(t *testing.T) {
{ sheetName : "Sheet2" , cell : "AV32" , opts : & Chart { Type : "contour" , Series : series , Format : format , Legend : legend , Title : ChartTitle { Name : "Contour Chart" } , PlotArea : plotArea , ShowBlanksAs : "zero" } } ,
{ sheetName : "Sheet2" , cell : "BD1" , opts : & Chart { Type : "wireframeContour" , Series : series , Format : format , Legend : legend , Title : ChartTitle { Name : "Wireframe Contour Chart" } , PlotArea : plotArea , ShowBlanksAs : "zero" } } ,
// bubble chart
{ sheetName : "Sheet2" , cell : "BD16" , opts : & Chart { Type : "bubble" , Series : series , Format : format , Legend : legend , Title : ChartTitle { Name : "Bubble Chart" } , PlotArea : plotArea , ShowBlanksAs : "zero" } } ,
{ 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 } } } ,
{ sheetName : "Sheet2" , cell : "BD16" , opts : & Chart { Type : "bubble" , Series : series 4 , Format : format , Legend : legend , Title : ChartTitle { Name : "Bubble Chart" } , PlotArea : plotArea , ShowBlanksAs : "zero" } } ,
{ sheetName : "Sheet2" , cell : "BD32" , opts : & Chart { Type : "bubble3D" , Series : series 4 , Format : format , Legend : legend , Title : ChartTitle { Name : "Bubble 3D Chart" } , PlotArea : plotArea , ShowBlanksAs : "zero" , XAxis : ChartAxis { MajorGridLines : true } , YAxis : ChartAxis { MajorGridLines : true } } } ,
// pie of pie chart
{ 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 } } } ,
// bar of pie chart
@ -256,18 +268,14 @@ func TestAddChart(t *testing.T) {
assert . NoError ( t , err )
clusteredColumnCombo := [ ] [ ] string {
{ "A1" , "line" , "Clustered Column - Line Chart" } ,
{ "I1" , "bubble" , "Clustered Column - Bubble Chart" } ,
{ "Q1" , "bubble3D" , "Clustered Column - Bubble 3D Chart" } ,
{ "Y1" , "doughnut" , "Clustered Column - Doughnut Chart" } ,
{ "I1" , "doughnut" , "Clustered Column - Doughnut Chart" } ,
}
for _ , props := range clusteredColumnCombo {
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 } } ) )
}
stackedAreaCombo := map [ string ] [ ] string {
"A16" : { "line" , "Stacked Area - Line Chart" } ,
"I16" : { "bubble" , "Stacked Area - Bubble Chart" } ,
"Q16" : { "bubble3D" , "Stacked Area - Bubble 3D Chart" } ,
"Y16" : { "doughnut" , "Stacked Area - Doughnut Chart" } ,
"I16" : { "doughnut" , "Stacked Area - Doughnut Chart" } ,
}
for axis , props := range stackedAreaCombo {
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 } } ) )