Skip to content

Commit

Permalink
Support set the data labels position for the chart
Browse files Browse the repository at this point in the history
- Add new field DataLabelPosition in the ChartSeries data type, support to sets the position of the chart series data label
- Add new field BubbleSize in the Chart data type, support set the bubble size in all data series for the bubble chart or 3D bubble chart
- Add new exported ChartDataLabelPositionType data type
- Update docs and unit test for the AddChart function
- Upgrade the Excelize to the master branch code
  • Loading branch information
xuri committed Dec 17, 2023
1 parent 8c20566 commit 253315b
Show file tree
Hide file tree
Showing 4 changed files with 612 additions and 100 deletions.
4 changes: 2 additions & 2 deletions cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.16
require (
github.com/stretchr/testify v1.8.1
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 // indirect
github.com/xuri/excelize/v2 v2.8.1-0.20231209040829-7b3dd03947bd
golang.org/x/image v0.12.0
github.com/xuri/excelize/v2 v2.8.1-0.20231215050942-00d62590f479
golang.org/x/image v0.14.0
golang.org/x/net v0.19.0 // indirect
)
8 changes: 4 additions & 4 deletions cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 h1:Chd9DkqERQQuHpXjR/HSV1jLZA6uaoiwwH3vSuF3IW0=
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
github.com/xuri/excelize/v2 v2.8.1-0.20231209040829-7b3dd03947bd h1:tfqTfaghoYWh9qDjM/RaNKId/3DRMUGeNCVwaOfG2DI=
github.com/xuri/excelize/v2 v2.8.1-0.20231209040829-7b3dd03947bd/go.mod h1:iwipck2q5caqRjROpapZpVqnlcAxBnE7CuLOJ8oNF/I=
github.com/xuri/excelize/v2 v2.8.1-0.20231215050942-00d62590f479 h1:DL20tUKLncWXefN1/yI86CNLJd3gvb62V+YFP3UmMmc=
github.com/xuri/excelize/v2 v2.8.1-0.20231215050942-00d62590f479/go.mod h1:iwipck2q5caqRjROpapZpVqnlcAxBnE7CuLOJ8oNF/I=
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 h1:qhbILQo1K3mphbwKh1vNm4oGezE1eF9fQWmNiIpSfI4=
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand All @@ -31,8 +31,8 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8=
golang.org/x/image v0.12.0 h1:w13vZbU4o5rKOFFR8y7M+c4A5jXDC0uXTdHYRP8X2DQ=
golang.org/x/image v0.12.0/go.mod h1:Lu90jvHG7GfemOIcldsh9A2hS01ocl6oNO7ype5mEnk=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
Expand Down
14 changes: 14 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,20 @@ func regConstants() {
} {
js.Global().Get("excelize").Set(name, constant)
}
for name, constant := range map[string]int{
"ChartDataLabelsPositionUnset": int(excelize.ChartDataLabelsPositionUnset),
"ChartDataLabelsPositionBestFit": int(excelize.ChartDataLabelsPositionBestFit),
"ChartDataLabelsPositionBelow": int(excelize.ChartDataLabelsPositionBelow),
"ChartDataLabelsPositionCenter": int(excelize.ChartDataLabelsPositionCenter),
"ChartDataLabelsPositionInsideBase": int(excelize.ChartDataLabelsPositionInsideBase),
"ChartDataLabelsPositionInsideEnd": int(excelize.ChartDataLabelsPositionInsideEnd),
"ChartDataLabelsPositionLeft": int(excelize.ChartDataLabelsPositionLeft),
"ChartDataLabelsPositionOutsideEnd": int(excelize.ChartDataLabelsPositionOutsideEnd),
"ChartDataLabelsPositionRight": int(excelize.ChartDataLabelsPositionRight),
"ChartDataLabelsPositionAbove": int(excelize.ChartDataLabelsPositionAbove),
} {
js.Global().Get("excelize").Set(name, constant)
}
}

// regInteropFunc register all exported JavaScript functions.
Expand Down
Loading

0 comments on commit 253315b

Please sign in to comment.