We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I set the text alignment direction for the horizontal axis
The text was updated successfully, but these errors were encountered:
5f446f2
Thanks for your issue. I added new field Alignment in the ChartAxis data type to support set chart axis text direction and rotation. For example:
Alignment
ChartAxis
package main import ( "fmt" "github.com/xuri/excelize/v2" ) func main() { f := excelize.NewFile() defer func() { if err := f.Close(); err != nil { fmt.Println(err) } }() for idx, row := range [][]interface{}{ {nil, "Apple", "Orange", "Pear"}, {"Small", 2, 3, 3}, {"Normal", 5, 2, 4}, {"Large", 6, 7, 8}, } { cell, err := excelize.CoordinatesToCellName(1, idx+1) if err != nil { fmt.Println(err) return } f.SetSheetRow("Sheet1", cell, &row) } if err := f.AddChart("Sheet1", "E1", &excelize.Chart{ Type: excelize.Col3DClustered, Series: []excelize.ChartSeries{ { Name: "Sheet1!$A$2", Categories: "Sheet1!$B$1:$D$1", Values: "Sheet1!$B$2:$D$2", }, { Name: "Sheet1!$A$3", Categories: "Sheet1!$B$1:$D$1", Values: "Sheet1!$B$3:$D$3", }, { Name: "Sheet1!$A$4", Categories: "Sheet1!$B$1:$D$1", Values: "Sheet1!$B$4:$D$4", }}, Title: []excelize.RichTextRun{ { Text: "Fruit 3D Clustered Column Chart", }, }, XAxis: excelize.ChartAxis{ + Alignment: excelize.Alignment{ + Vertical: "wordArtVertRtl", + TextRotation: 0, + }, }, }); err != nil { fmt.Println(err) return } // Save spreadsheet by the given path. if err := f.SaveAs("Book1.xlsx"); err != nil { fmt.Println(err) } }
Please upgrade to the master branch code by following command, and this feature will be released in the next version 2.9.1.
go get -u github.com/xuri/excelize/v2@master
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Can I set the text alignment direction for the horizontal axis

The text was updated successfully, but these errors were encountered: