Skip to content

Commit 407fb55

Browse files
committed
Update the Godoc
1 parent da99334 commit 407fb55

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
## 简介
1515

16-
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/)
16+
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/)
1717

1818
## 快速上手
1919

excelize_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ func TestSetCellStyleFont(t *testing.T) {
640640
}
641641

642642
var style int
643-
style, err = f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Berlin Sans FB Demi","size":36,"color":"#777777","underline":"single"}}`)
643+
style, err = f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777","underline":"single"}}`)
644644
if !assert.NoError(t, err) {
645645
t.FailNow()
646646
}
@@ -809,7 +809,7 @@ func TestAddShape(t *testing.T) {
809809
f.AddShape("Sheet1", "A30", `{"type":"rect","paragraph":[{"text":"Rectangle","font":{"color":"CD5C5C"}},{"text":"Shape","font":{"bold":true,"color":"2980B9"}}]}`)
810810
f.AddShape("Sheet1", "B30", `{"type":"rect","paragraph":[{"text":"Rectangle"},{}]}`)
811811
f.AddShape("Sheet1", "C30", `{"type":"rect","paragraph":[]}`)
812-
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}`)
812+
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}`)
813813
f.AddShape("Sheet3", "H1", "")
814814

815815
assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddShape.xlsx")))

shape.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func parseFormatShapeSet(formatSet string) (*formatShape, error) {
4040
// print settings) and properties set. For example, add text box (rect shape)
4141
// in Sheet1:
4242
//
43-
// 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}`)
43+
// 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}`)
4444
//
4545
// The following shows the type of shape supported by excelize:
4646
//

sparkline.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,15 @@ func (f *File) addSparklineGroupByStyle(ID int) *xlsxX14SparklineGroup {
374374
// Parameter | Description
375375
// -----------+--------------------------------------------
376376
// Location | Required, must have the same number with 'Range' parameter
377-
// Range |Required, must have the same number with 'Location' parameter
377+
// Range | Required, must have the same number with 'Location' parameter
378378
// Type | Enumeration value: line, column, win_loss
379379
// Style | Value range: 0 - 35
380-
// Hight | Toggle sparkine high points
381-
// Low | Toggle sparkine low points
382-
// First | Toggle sparkine first points
383-
// Last | Toggle sparkine last points
384-
// Negative | Toggle sparkine negative points
385-
// Markers | Toggle sparkine markers
380+
// Hight | Toggle sparkline high points
381+
// Low | Toggle sparkline low points
382+
// First | Toggle sparkline first points
383+
// Last | Toggle sparkline last points
384+
// Negative | Toggle sparkline negative points
385+
// Markers | Toggle sparkline markers
386386
// ColorAxis | An RGB Color is specified as RRGGBB
387387
// Axis | Show sparkline axis
388388
//

styles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,7 @@ func (f *File) GetCellStyle(sheet, axis string) (int, error) {
23512351
//
23522352
// Set font style for cell H9 on Sheet1:
23532353
//
2354-
// style, err := f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Berlin Sans FB Demi","size":36,"color":"#777777"}}`)
2354+
// style, err := f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777"}}`)
23552355
// if err != nil {
23562356
// fmt.Println(err)
23572357
// }

styles_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ func TestSetConditionalFormat(t *testing.T) {
168168

169169
func TestNewStyle(t *testing.T) {
170170
f := NewFile()
171-
styleID, err := f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Berlin Sans FB Demi","size":36,"color":"#777777"}}`)
171+
styleID, err := f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777"}}`)
172172
if err != nil {
173173
t.Fatal(err)
174174
}
175175
styles := f.stylesReader()
176176
fontID := styles.CellXfs.Xf[styleID].FontID
177177
font := styles.Fonts.Font[fontID]
178-
assert.Contains(t, font.Name.Val, "Berlin Sans FB Demi", "Stored font should contain font name")
178+
assert.Contains(t, font.Name.Val, "Times New Roman", "Stored font should contain font name")
179179
assert.Equal(t, 2, styles.CellXfs.Count, "Should have 2 styles")
180180
}
181181

0 commit comments

Comments
 (0)