• R/O
  • HTTP
  • SSH
  • HTTPS

excelize: 提交

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets


Commit MetaInfo

修订版71829c520235b733870563f30dceef9ef4dbbb98 (tree)
时间2020-12-27 01:18:54
作者xuri <xuri.me@gmai...>
Commiterxuri

Log Message

AddChart support disable legend of the chart

更改概述

差异

--- a/README.md
+++ b/README.md
@@ -112,7 +112,8 @@ import (
112112
113113 func main() {
114114 categories := map[string]string{
115- "A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
115+ "A2": "Small", "A3": "Normal", "A4": "Large",
116+ "B1": "Apple", "C1": "Orange", "D1": "Pear"}
116117 values := map[string]int{
117118 "B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
118119 f := excelize.NewFile()
--- a/README_zh.md
+++ b/README_zh.md
@@ -112,7 +112,8 @@ import (
112112
113113 func main() {
114114 categories := map[string]string{
115- "A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
115+ "A2": "Small", "A3": "Normal", "A4": "Large",
116+ "B1": "Apple", "C1": "Orange", "D1": "Pear"}
116117 values := map[string]int{
117118 "B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
118119 f := excelize.NewFile()
--- a/chart.go
+++ b/chart.go
@@ -514,8 +514,11 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) {
514514 // )
515515 //
516516 // func main() {
517-// categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
518-// values := map[string]int{"B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
517+// categories := map[string]string{
518+// "A2": "Small", "A3": "Normal", "A4": "Large",
519+// "B1": "Apple", "C1": "Orange", "D1": "Pear"}
520+// values := map[string]int{
521+// "B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
519522 // f := excelize.NewFile()
520523 // for k, v := range categories {
521524 // f.SetCellValue("Sheet1", k, v)
@@ -523,7 +526,54 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) {
523526 // for k, v := range values {
524527 // f.SetCellValue("Sheet1", k, v)
525528 // }
526-// if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true},"show_blanks_as":"zero","x_axis":{"reverse_order":true},"y_axis":{"maximum":7.5,"minimum":0.5}}`); err != nil {
529+// if err := f.AddChart("Sheet1", "E1", `{
530+// "type": "col3DClustered",
531+// "series": [
532+// {
533+// "name": "Sheet1!$A$2",
534+// "categories": "Sheet1!$B$1:$D$1",
535+// "values": "Sheet1!$B$2:$D$2"
536+// },
537+// {
538+// "name": "Sheet1!$A$3",
539+// "categories": "Sheet1!$B$1:$D$1",
540+// "values": "Sheet1!$B$3:$D$3"
541+// },
542+// {
543+// "name": "Sheet1!$A$4",
544+// "categories": "Sheet1!$B$1:$D$1",
545+// "values": "Sheet1!$B$4:$D$4"
546+// }],
547+// "title":
548+// {
549+// "name": "Fruit 3D Clustered Column Chart"
550+// },
551+// "legend":
552+// {
553+// "none": false,
554+// "position": "bottom",
555+// "show_legend_key": false
556+// },
557+// "plotarea":
558+// {
559+// "show_bubble_size": true,
560+// "show_cat_name": false,
561+// "show_leader_lines": false,
562+// "show_percent": true,
563+// "show_series_name": true,
564+// "show_val": true
565+// },
566+// "show_blanks_as": "zero",
567+// "x_axis":
568+// {
569+// "reverse_order": true
570+// },
571+// "y_axis":
572+// {
573+// "maximum": 7.5,
574+// "minimum": 0.5
575+// }
576+// }`); err != nil {
527577 // fmt.Println(err)
528578 // return
529579 // }
@@ -627,10 +677,13 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) {
627677 //
628678 // Set properties of the chart legend. The options that can be set are:
629679 //
680+// none
630681 // position
631682 // show_legend_key
632683 //
633-// position: Set the position of the chart legend. The default legend position is right. The available positions are:
684+// none: Specified if show the legend without overlapping the chart. The default value is 'false'.
685+//
686+// position: Set the position of the chart legend. The default legend position is right. This parameter only takes effect when 'none' is false. The available positions are:
634687 //
635688 // top
636689 // bottom
@@ -728,8 +781,11 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) {
728781 // )
729782 //
730783 // func main() {
731-// categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
732-// values := map[string]int{"B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
784+// categories := map[string]string{
785+// "A2": "Small", "A3": "Normal", "A4": "Large",
786+// "B1": "Apple", "C1": "Orange", "D1": "Pear"}
787+// values := map[string]int{
788+// "B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
733789 // f := excelize.NewFile()
734790 // for k, v := range categories {
735791 // f.SetCellValue("Sheet1", k, v)
@@ -737,7 +793,85 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) {
737793 // for k, v := range values {
738794 // f.SetCellValue("Sheet1", k, v)
739795 // }
740-// if err := f.AddChart("Sheet1", "E1", `{"type":"col","series":[{"name":"Sheet1!$A$2","categories":"","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"title":{"name":"Clustered Column - Line Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true}}`, `{"type":"line","series":[{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4","marker":{"symbol":"none","size":10}}],"format":{"x_scale":1,"y_scale":1,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true}}`); err != nil {
796+// if err := f.AddChart("Sheet1", "E1", `{
797+// "type": "col",
798+// "series": [
799+// {
800+// "name": "Sheet1!$A$2",
801+// "categories": "",
802+// "values": "Sheet1!$B$2:$D$2"
803+// },
804+// {
805+// "name": "Sheet1!$A$3",
806+// "categories": "Sheet1!$B$1:$D$1",
807+// "values": "Sheet1!$B$3:$D$3"
808+// }],
809+// "format":
810+// {
811+// "x_scale": 1.0,
812+// "y_scale": 1.0,
813+// "x_offset": 15,
814+// "y_offset": 10,
815+// "print_obj": true,
816+// "lock_aspect_ratio": false,
817+// "locked": false
818+// },
819+// "title":
820+// {
821+// "name": "Clustered Column - Line Chart"
822+// },
823+// "legend":
824+// {
825+// "position": "left",
826+// "show_legend_key": false
827+// },
828+// "plotarea":
829+// {
830+// "show_bubble_size": true,
831+// "show_cat_name": false,
832+// "show_leader_lines": false,
833+// "show_percent": true,
834+// "show_series_name": true,
835+// "show_val": true
836+// }
837+// }`, `{
838+// "type": "line",
839+// "series": [
840+// {
841+// "name": "Sheet1!$A$4",
842+// "categories": "Sheet1!$B$1:$D$1",
843+// "values": "Sheet1!$B$4:$D$4",
844+// "marker":
845+// {
846+// "symbol": "none",
847+// "size": 10
848+// }
849+// }],
850+// "format":
851+// {
852+// "x_scale": 1,
853+// "y_scale": 1,
854+// "x_offset": 15,
855+// "y_offset": 10,
856+// "print_obj": true,
857+// "lock_aspect_ratio": false,
858+// "locked": false
859+// },
860+// "legend":
861+// {
862+// "position": "right",
863+// "show_legend_key": false
864+// },
865+// "plotarea":
866+// {
867+// "show_bubble_size": true,
868+// "show_cat_name": false,
869+// "show_leader_lines": false,
870+// "show_percent": true,
871+// "show_series_name": true,
872+// "show_val": true
873+// }
874+// }`); err != nil {
741875 // fmt.Println(err)
742876 // return
743877 // }
--- a/chart_test.go
+++ b/chart_test.go
@@ -116,7 +116,7 @@ func TestAddChart(t *testing.T) {
116116 // Test add chart on not exists worksheet.
117117 assert.EqualError(t, f.AddChart("SheetN", "P1", "{}"), "sheet SheetN is not exist")
118118
119- assert.NoError(t, f.AddChart("Sheet1", "P1", `{"type":"col","series":[{"name":"Sheet1!$A$30","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$30:$D$30"},{"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"},{"name":"Sheet1!$A$34","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$34:$D$34"},{"name":"Sheet1!$A$35","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$35:$D$35"},{"name":"Sheet1!$A$36","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$36:$D$36"},{"name":"Sheet1!$A$37","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$37:$D$37"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"title":{"name":"2D Column Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true},"show_blanks_as":"zero"}`))
119+ assert.NoError(t, f.AddChart("Sheet1", "P1", `{"type":"col","series":[{"name":"Sheet1!$A$30","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$30:$D$30"},{"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"},{"name":"Sheet1!$A$34","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$34:$D$34"},{"name":"Sheet1!$A$35","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$35:$D$35"},{"name":"Sheet1!$A$36","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$36:$D$36"},{"name":"Sheet1!$A$37","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$37:$D$37"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"none":true,"show_legend_key":true},"title":{"name":"2D Column Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true},"show_blanks_as":"zero"}`))
120120 assert.NoError(t, f.AddChart("Sheet1", "X1", `{"type":"colStacked","series":[{"name":"Sheet1!$A$30","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$30:$D$30"},{"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"},{"name":"Sheet1!$A$34","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$34:$D$34"},{"name":"Sheet1!$A$35","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$35:$D$35"},{"name":"Sheet1!$A$36","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$36:$D$36"},{"name":"Sheet1!$A$37","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$37:$D$37"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"title":{"name":"2D Stacked Column Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true},"show_blanks_as":"zero"}`))
121121 assert.NoError(t, f.AddChart("Sheet1", "P16", `{"type":"colPercentStacked","series":[{"name":"Sheet1!$A$30","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$30:$D$30"},{"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"},{"name":"Sheet1!$A$34","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$34:$D$34"},{"name":"Sheet1!$A$35","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$35:$D$35"},{"name":"Sheet1!$A$36","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$36:$D$36"},{"name":"Sheet1!$A$37","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$37:$D$37"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"title":{"name":"100% Stacked Column Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true},"show_blanks_as":"zero"}`))
122122 assert.NoError(t, f.AddChart("Sheet1", "X16", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$30","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$30:$D$30"},{"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"},{"name":"Sheet1!$A$34","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$34:$D$34"},{"name":"Sheet1!$A$35","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$35:$D$35"},{"name":"Sheet1!$A$36","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$36:$D$36"},{"name":"Sheet1!$A$37","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$37:$D$37"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"bottom","show_legend_key":false},"title":{"name":"3D Clustered Column Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true},"show_blanks_as":"zero"}`))
@@ -179,14 +179,14 @@ func TestAddChart(t *testing.T) {
179179 assert.NoError(t, f.AddChart("Sheet2", "BD64", `{"type":"barOfPie","series":[{"name":"Sheet1!$A$30","categories":"Sheet1!$A$30:$D$37","values":"Sheet1!$B$30:$B$37"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"title":{"name":"Bar of Pie Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true},"show_blanks_as":"zero","x_axis":{"major_grid_lines":true},"y_axis":{"major_grid_lines":true}}`))
180180 // combo chart
181181 f.NewSheet("Combo Charts")
182- clusteredColumnCombo := map[string][]string{
183- "A1": {"line", "Clustered Column - Line Chart"},
184- "I1": {"bubble", "Clustered Column - Bubble Chart"},
185- "Q1": {"bubble3D", "Clustered Column - Bubble 3D Chart"},
186- "Y1": {"doughnut", "Clustered Column - Doughnut Chart"},
182+ clusteredColumnCombo := [][]string{
183+ {"A1", "line", "Clustered Column - Line Chart"},
184+ {"I1", "bubble", "Clustered Column - Bubble Chart"},
185+ {"Q1", "bubble3D", "Clustered Column - Bubble 3D Chart"},
186+ {"Y1", "doughnut", "Clustered Column - Doughnut Chart"},
187187 }
188- for axis, props := range clusteredColumnCombo {
189- assert.NoError(t, f.AddChart("Combo Charts", axis, fmt.Sprintf(`{"type":"col","series":[{"name":"Sheet1!$A$30","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$30:$D$30"},{"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"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"title":{"name":"%s"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true}}`, props[1]), fmt.Sprintf(`{"type":"%s","series":[{"name":"Sheet1!$A$34","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$34:$D$34"},{"name":"Sheet1!$A$35","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$35:$D$35"},{"name":"Sheet1!$A$36","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$36:$D$36"},{"name":"Sheet1!$A$37","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$37:$D$37"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true}}`, props[0])))
188+ for _, props := range clusteredColumnCombo {
189+ assert.NoError(t, f.AddChart("Combo Charts", props[0], fmt.Sprintf(`{"type":"col","series":[{"name":"Sheet1!$A$30","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$30:$D$30"},{"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"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"title":{"name":"%s"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true}}`, props[2]), fmt.Sprintf(`{"type":"%s","series":[{"name":"Sheet1!$A$34","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$34:$D$34"},{"name":"Sheet1!$A$35","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$35:$D$35"},{"name":"Sheet1!$A$36","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$36:$D$36"},{"name":"Sheet1!$A$37","categories":"Sheet1!$B$29:$D$29","values":"Sheet1!$B$37:$D$37"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true}}`, props[1])))
190190 }
191191 stackedAreaCombo := map[string][]string{
192192 "A16": {"line", "Stacked Area - Line Chart"},
--- a/drawing.go
+++ b/drawing.go
@@ -236,6 +236,9 @@ func (f *File) addChart(formatSet *formatChart, comboCharts []*formatChart) {
236236 Bubble: f.drawBaseChart,
237237 Bubble3D: f.drawBaseChart,
238238 }
239+ if formatSet.Legend.None {
240+ xlsxChartSpace.Chart.Legend = nil
241+ }
239242 addChart := func(c, p *cPlotArea) {
240243 immutable, mutable := reflect.ValueOf(c).Elem(), reflect.ValueOf(p).Elem()
241244 for i := 0; i < mutable.NumField(); i++ {
Show on old repository browser