Browse Source

Update the Godoc

xuri 6 years ago
parent
commit
407fb55c20
6 changed files with 14 additions and 14 deletions
  1. 1 1
      README_zh.md
  2. 2 2
      excelize_test.go
  3. 1 1
      shape.go
  4. 7 7
      sparkline.go
  5. 1 1
      styles.go
  6. 2 2
      styles_test.go

+ 1 - 1
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/)。
 
 
 ## 快速上手
 ## 快速上手
 
 

+ 2 - 2
excelize_test.go

@@ -640,7 +640,7 @@ func TestSetCellStyleFont(t *testing.T) {
 	}
 	}
 
 
 	var style int
 	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) {
 	if !assert.NoError(t, err) {
 		t.FailNow()
 		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", "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", "B30", `{"type":"rect","paragraph":[{"text":"Rectangle"},{}]}`)
 	f.AddShape("Sheet1", "C30", `{"type":"rect","paragraph":[]}`)
 	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", "")
 	f.AddShape("Sheet3", "H1", "")
 
 
 	assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddShape.xlsx")))
 	assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddShape.xlsx")))

+ 1 - 1
shape.go

@@ -40,7 +40,7 @@ func parseFormatShapeSet(formatSet string) (*formatShape, error) {
 // print settings) and properties set. For example, add text box (rect shape)
 // print settings) and properties set. For example, add text box (rect shape)
 // in Sheet1:
 // 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:
 // The following shows the type of shape supported by excelize:
 //
 //

+ 7 - 7
sparkline.go

@@ -374,15 +374,15 @@ func (f *File) addSparklineGroupByStyle(ID int) *xlsxX14SparklineGroup {
 //     Parameter | Description
 //     Parameter | Description
 //    -----------+--------------------------------------------
 //    -----------+--------------------------------------------
 //     Location  | Required, must have the same number with 'Range' parameter
 //     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
 //     Type      | Enumeration value: line, column, win_loss
 //     Style     | Value range: 0 - 35
 //     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
 //     ColorAxis | An RGB Color is specified as RRGGBB
 //     Axis      | Show sparkline axis
 //     Axis      | Show sparkline axis
 //
 //

+ 1 - 1
styles.go

@@ -2351,7 +2351,7 @@ func (f *File) GetCellStyle(sheet, axis string) (int, error) {
 //
 //
 // Set font style for cell H9 on Sheet1:
 // 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 {
 //    if err != nil {
 //        fmt.Println(err)
 //        fmt.Println(err)
 //    }
 //    }

+ 2 - 2
styles_test.go

@@ -168,14 +168,14 @@ func TestSetConditionalFormat(t *testing.T) {
 
 
 func TestNewStyle(t *testing.T) {
 func TestNewStyle(t *testing.T) {
 	f := NewFile()
 	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 {
 	if err != nil {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}
 	styles := f.stylesReader()
 	styles := f.stylesReader()
 	fontID := styles.CellXfs.Xf[styleID].FontID
 	fontID := styles.CellXfs.Xf[styleID].FontID
 	font := styles.Fonts.Font[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")
 	assert.Equal(t, 2, styles.CellXfs.Count, "Should have 2 styles")
 }
 }