diff options
author | xuri <xuri.me@gmail.com> | 2019-08-21 23:03:34 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-08-21 23:03:34 +0800 |
commit | 407fb55c20a2524c4eccad9361120dee2a2719cd (patch) | |
tree | ae16f68165d5cbdcbdb1ac7675f1051fe10f6734 | |
parent | da99334fca412c33e9e077703e7373b0899e8a87 (diff) |
Update the Godoc
-rw-r--r-- | README_zh.md | 2 | ||||
-rw-r--r-- | excelize_test.go | 4 | ||||
-rw-r--r-- | shape.go | 2 | ||||
-rw-r--r-- | sparkline.go | 14 | ||||
-rw-r--r-- | styles.go | 2 | ||||
-rw-r--r-- | styles_test.go | 4 |
6 files changed, 14 insertions, 14 deletions
diff --git a/README_zh.md b/README_zh.md index 044d930..d57f301 100644 --- a/README_zh.md +++ b/README_zh.md @@ -13,7 +13,7 @@ ## 简介 -Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.8 或更高版本,完整的 API 使用文档请访问 [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) 或查看 [参考文档](https://xuri.me/excelize/)。 +Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) 或查看 [参考文档](https://xuri.me/excelize/)。 ## 快速上手 diff --git a/excelize_test.go b/excelize_test.go index d61dd7b..a5d7671 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -640,7 +640,7 @@ func TestSetCellStyleFont(t *testing.T) { } var style int - style, err = f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Berlin Sans FB Demi","size":36,"color":"#777777","underline":"single"}}`) + style, err = f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777","underline":"single"}}`) if !assert.NoError(t, err) { t.FailNow() } @@ -809,7 +809,7 @@ func TestAddShape(t *testing.T) { f.AddShape("Sheet1", "A30", `{"type":"rect","paragraph":[{"text":"Rectangle","font":{"color":"CD5C5C"}},{"text":"Shape","font":{"bold":true,"color":"2980B9"}}]}`) f.AddShape("Sheet1", "B30", `{"type":"rect","paragraph":[{"text":"Rectangle"},{}]}`) f.AddShape("Sheet1", "C30", `{"type":"rect","paragraph":[]}`) - f.AddShape("Sheet3", "H1", `{"type":"ellipseRibbon", "color":{"line":"#4286f4","fill":"#8eb9ff"}, "paragraph":[{"font":{"bold":true,"italic":true,"family":"Berlin Sans FB Demi","size":36,"color":"#777777","underline":"single"}}], "height": 90}`) + f.AddShape("Sheet3", "H1", `{"type":"ellipseRibbon", "color":{"line":"#4286f4","fill":"#8eb9ff"}, "paragraph":[{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777","underline":"single"}}], "height": 90}`) f.AddShape("Sheet3", "H1", "") assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddShape.xlsx"))) @@ -40,7 +40,7 @@ func parseFormatShapeSet(formatSet string) (*formatShape, error) { // print settings) and properties set. For example, add text box (rect shape) // in Sheet1: // -// err := f.AddShape("Sheet1", "G6", `{"type":"rect","color":{"line":"#4286F4","fill":"#8eb9ff"},"paragraph":[{"text":"Rectangle Shape","font":{"bold":true,"italic":true,"family":"Berlin Sans FB Demi","size":36,"color":"#777777","underline":"sng"}}],"width":180,"height": 90}`) +// err := f.AddShape("Sheet1", "G6", `{"type":"rect","color":{"line":"#4286F4","fill":"#8eb9ff"},"paragraph":[{"text":"Rectangle Shape","font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777","underline":"sng"}}],"width":180,"height": 90}`) // // The following shows the type of shape supported by excelize: // diff --git a/sparkline.go b/sparkline.go index 18eae6c..314ea83 100644 --- a/sparkline.go +++ b/sparkline.go @@ -374,15 +374,15 @@ func (f *File) addSparklineGroupByStyle(ID int) *xlsxX14SparklineGroup { // Parameter | Description // -----------+-------------------------------------------- // Location | Required, must have the same number with 'Range' parameter -// Range |Required, must have the same number with 'Location' parameter +// Range | Required, must have the same number with 'Location' parameter // Type | Enumeration value: line, column, win_loss // Style | Value range: 0 - 35 -// Hight | Toggle sparkine high points -// Low | Toggle sparkine low points -// First | Toggle sparkine first points -// Last | Toggle sparkine last points -// Negative | Toggle sparkine negative points -// Markers | Toggle sparkine markers +// Hight | Toggle sparkline high points +// Low | Toggle sparkline low points +// First | Toggle sparkline first points +// Last | Toggle sparkline last points +// Negative | Toggle sparkline negative points +// Markers | Toggle sparkline markers // ColorAxis | An RGB Color is specified as RRGGBB // Axis | Show sparkline axis // @@ -2351,7 +2351,7 @@ func (f *File) GetCellStyle(sheet, axis string) (int, error) { // // Set font style for cell H9 on Sheet1: // -// style, err := f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Berlin Sans FB Demi","size":36,"color":"#777777"}}`) +// style, err := f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777"}}`) // if err != nil { // fmt.Println(err) // } diff --git a/styles_test.go b/styles_test.go index decfbb9..36a78ed 100644 --- a/styles_test.go +++ b/styles_test.go @@ -168,14 +168,14 @@ func TestSetConditionalFormat(t *testing.T) { func TestNewStyle(t *testing.T) { f := NewFile() - styleID, err := f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Berlin Sans FB Demi","size":36,"color":"#777777"}}`) + styleID, err := f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777"}}`) if err != nil { t.Fatal(err) } styles := f.stylesReader() fontID := styles.CellXfs.Xf[styleID].FontID font := styles.Fonts.Font[fontID] - assert.Contains(t, font.Name.Val, "Berlin Sans FB Demi", "Stored font should contain font name") + assert.Contains(t, font.Name.Val, "Times New Roman", "Stored font should contain font name") assert.Equal(t, 2, styles.CellXfs.Count, "Should have 2 styles") } |