Documentation ¶
Index ¶
- Constants
- Variables
- func AddChartWithSheet(key, sheet string, chartType ExcelChartType, f *excelize.File) (*excelize.File, error)
- func AddNewSheet(data []jsonutils.JSONObject, keys []string, texts []string, sheet string, ...) *excelize.File
- func CheckChartType(chartType string) bool
- func Export(data []jsonutils.JSONObject, keys []string, texts []string, writer io.Writer) error
- func ExportFile(data []jsonutils.JSONObject, keys []string, texts []string, filename string) error
- func ExportWriter(data []jsonutils.JSONObject, keys []string, texts []string, writer io.Writer) *excelize.File
- func ReadDataWithRow(f *excelize.File, sheet string) (jsonutils.JSONObject, error)
- func SetCellStyleWithColumnKey(keys []string, sheet, style string, f *excelize.File) (*excelize.File, error)
- type ExcelChartType
- type SExcelChartFormat
- type SExcelChartParams
- type SExcelChartSeries
- type SExcelChartTitle
Constants ¶
View Source
const ( // 千位分隔 CELL_STYLE_THOUSANDS_SEPARATOR string = `#,##0.00_)` )
View Source
const (
DEFAULT_SHEET = "Sheet1"
)
Variables ¶
View Source
var ChartMap = map[ExcelChartType]string{ CHART_TYPE_LINE: "折线图", CHART_TYPE_PIE: "饼图", CHART_TYPE_RADAR: "雷达图", CHART_TYPE_SCATTER: "散点图", CHART_TYPE_COL: "柱状图", }
Functions ¶
func AddChartWithSheet ¶
func AddNewSheet ¶
func CheckChartType ¶
func ExportFile ¶
key:data中对应的key,text:头
func ExportWriter ¶
func ReadDataWithRow ¶
按行读取excel文件,注:第一行为json的key
Types ¶
type ExcelChartType ¶
type ExcelChartType string
const ( CHART_TYPE_LINE ExcelChartType = "line" // 折线图 CHART_TYPE_PIE ExcelChartType = "pie" // 饼图 CHART_TYPE_RADAR ExcelChartType = "radar" // 雷达图 CHART_TYPE_SCATTER ExcelChartType = "scatter" // 散点图 CHART_TYPE_COL ExcelChartType = "col" // 柱状图 )
type SExcelChartFormat ¶
type SExcelChartParams ¶
type SExcelChartParams struct { Type ExcelChartType Series []SExcelChartSeries Title SExcelChartTitle Format SExcelChartFormat }
type SExcelChartSeries ¶
type SExcelChartTitle ¶
type SExcelChartTitle struct {
Name string
}
Click to show internal directories.
Click to hide internal directories.