Commit Graph

77 Commits

Author SHA1 Message Date
xuri 8c0ef7f90d
This closes #1983, support create combo chart with same types
- Add new exported ChartLineUnset enumeration
- Fix set line type of line chart does not work
- Support set line type of scatter chart
2024-09-05 21:38:19 +08:00
pjh591029530 68a1704900
This fix missing horizontal axis in scatter chart with negative values (#1953)
Co-authored-by: Simmons <1815481@qq.com>
2024-07-17 08:44:16 +08:00
Patrick Wang 431c31029e
This closes #1944, add new TickLabelPosition field in the ChartAxis data type (#1946)
- Introduce new exported ChartTickLabelPositionType enumeration
- Update unit tests
2024-07-11 14:39:16 +08:00
Vovka Morkovka 4e6457accd
This closes #1926, fix secondary vertical axis title is not displayed (#1928) 2024-06-21 08:13:12 +08:00
联盟少侠 1a99dd4a23
This closes #1921, fix set axis format doesn't work in combo chart (#1924)
- Fix incorrect primary axis titles position
2024-06-17 21:54:15 +08:00
xuri 688808b2b4
This closes #1819, formula calculation engine support array formulas
- Improve the defined name and table name validation rules
- Rename internal variable names to avoid the same with Go 1.21's built-in min and max functions
- Simplify data type conversion in internal code
- Update GitHub Actions workflow configuration, test on Go 1.22.x, and disable Go module cache
- Update dependencies module
2024-02-26 02:22:51 +08:00
coolbit bba155e06d
This closes #1805, support set chart axis font family, size and strike style (#1809)
- Update unit test workflow dependencies package version
2024-02-04 22:31:03 +08:00
MELF晓宇 5399572353
This closes #1786, support set fill color of the chart (#1788)
- Add a new field Fill in Chart, ChartPlotArea, and ChartMarker struct
- Support set solid color or transparent fill for chart area, plot area, and maker
2024-01-22 09:41:57 +08:00
3zmx 50e23df865
ref #65, support _xlfn.ANCHORARRAY formula function (#1784)
- Initial formula array calculation support
- Update unit test and documentation
2024-01-18 15:31:43 +08:00
xuri 792656552b
This closes #1777, fix the GetStyle or GetConditionalStyle function to returns incorrect DecimalPlaces field value
- Update documentation for the NewStyle function
- Update unit tests
- Update dependencies Go module
- Update GitHub workflow dependencies package version
- Update copyright agreement statement
2024-01-09 20:56:20 +08:00
xuri 8831afc558
This recover the Sizes field in the ChartSeries data type removed in commit dfaf418f34
- Update unit tests and documentation of the internal uintPtr function
2023-12-25 21:51:09 +08:00
yuegu520 dfaf418f34
This closes # 1704, support set the data labels position for the chart (#1755)
- Breaking change: remove the Sizes field in the ChartSeries data type
- 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
- Fix a v2.7.1 regression bug, the bubble is hidden in the bubble or 3D bubble chart, commit ID: c2d6707a85
2023-12-14 00:03:53 +08:00
xuri 4e936dafdd
This closes #1706 and closes #1708
- Add export ChartLineType enumeration to specify the chart line type
- Add new Border field in the Chart type to set the chart area border
- Add new Type field in the ChartLine type to set the line type
- Fix some format missing on get style definition
- Update the unit tests
2023-11-03 00:12:43 +08:00
xuri 87a00e4f7e
This closed #1680, fixing a potential issue that stream reader temporary files can not be clear
- Delete image files from the workbook internally when deleting pictures to reduce generated workbook size and resolve potential security issues
2023-10-09 00:14:56 +08:00
xuri 9c079e5eec
This fix #1665, supports getting formula string cell value
- Improve compatibility for absolute path drawing part
- Fix incorrect table ID generated in the workbook which contains single table cells
- Fix missing relationship parts in the content types in some cases
- Upgrade number format parser to fix missing literal tokens in some cases
- Update built-in zh-cn and zh-tw language number format
- Ref #65, init new formula function: TEXT
- Remove duplicate style-related variables
- Update the unit tests
2023-09-21 00:06:31 +08:00
xuri e3b7dad69a
Introduce the new exported function `AddSlicer` for adding table slicer
- Fix a v2.8.0 regression bug, generate workbook corruption caused by incorrect MRU colors style parts
- Fix corrupted workbooks generated when adding tables in some cases
- Added several exported extension list child element URI constants
- Move part of the internal constant and variables definition to the template source code file
- Updated unit tests
2023-09-16 12:21:11 +08:00
xuri ae17fa87d5
This ref #1585, support to read one cell anchor pictures and improve date and time number format
- Support apply date and time number format with 16 languages: Persian, Polish, Portuguese, Punjabi, Quechua, Romanian, Romansh, Sakha, Sami, Sanskrit, Scottish Gaelic, Serbian, Sesotho sa Leboa, Setswana, Sindhi, Sinhala and Slovak
- Update the unit test and dependencies modules
2023-08-09 00:11:06 +08:00
xuri a07c8cd0b4
This closes #1588, closes #1591, breaking changes for the `AddChart` function
- Removed exported `ChartTitle` data type
- The `AddChart` function now supports formatting and setting rich text titles for the chart
- New exported function `GetFormControl` for getting form control
- Made case in-sensitive for internal worksheet XML path to improve compatibility
- Update the unit tests
- Update the documentation and internal comments on the codes
2023-07-28 00:24:08 +08:00
xuri f5fe6d3fc9
This closes #518, support creating chart with a secondary series axis 2023-07-07 11:00:54 +00:00
xuri f8aa3adf7e
This closes #1553, the `AddChart` function support set primary titles
- Update unit tests and documentation
- Lint issues fixed
2023-06-18 00:13:03 +08:00
chengxinyao 9bc3fd7e9f
This optimize the code, simplify unit test and drawing object position calculation (#1561)
Co-authored-by: xinyao.cheng <xinyao.cheng@zerone.com.cn>
2023-06-14 22:49:40 +08:00
xuri 93c72b4d55
This optimizes internal functions signature and mutex declarations 2023-04-24 00:02:13 +08:00
xuri 294f2e1480
Require using ChartType enumeration value to specify the chart type
- Update docs and unit tests
2023-04-01 00:08:53 +08:00
xuri 7631fd08e1
This closes #1499, support to set number format for chart data labels and axis 2023-03-18 20:45:34 +08:00
xuri cb0c1b012b
Support specifies the values in second plot for the bar/pie of pie chart
- Upgrade dependencies package golang.org/x/image to 0.5.0
- Update unit tests
2023-02-19 00:18:11 +08:00
xuri c2d6707a85
This closes #1474, support set the format for the data series fill (solid fill)
- Breaking changes: remove the `Color` field in the `ChartLine` structure
- This support set the bubble size in a data series
- Unit test update and correct the docs of the function `GetSheetDimension`
2023-02-17 20:03:46 +08:00
xuri b39626fae9
This fixed worksheet protection issue
- Update example code in the documentation
- Update unit tests
- Rename `PictureOptions` to `GraphicOptions`
- Adjust partial options fields data types for the `PictureOptions` and `Shape` structure
- Update dependencies module
2023-01-02 11:47:31 +08:00
xuri f58dabd492
Breaking change: changed the function signature for 11 exported functions
* Change
    `func (f *File) NewConditionalStyle(style string) (int, error)`
    to
    `func (f *File) NewConditionalStyle(style *Style) (int, error)`
* Change
    `func (f *File) NewStyle(style interface{}) (int, error)`
     to
    `func (f *File) NewStyle(style *Style) (int, error)`
* Change
    `func (f *File) AddChart(sheet, cell, opts string, combo ...string) error`
     to
    `func (f *File) AddChart(sheet, cell string, chart *ChartOptions, combo ...*ChartOptions) error`
* Change
    `func (f *File) AddChartSheet(sheet, opts string, combo ...string) error`
     to
    `func (f *File) AddChartSheet(sheet string, chart *ChartOptions, combo ...*ChartOptions) error`
* Change
    `func (f *File) AddShape(sheet, cell, opts string) error`
     to
    `func (f *File) AddShape(sheet, cell string, opts *Shape) error`
* Change
    `func (f *File) AddPictureFromBytes(sheet, cell, opts, name, extension string, file []byte) error`
     to
    `func (f *File) AddPictureFromBytes(sheet, cell, name, extension string, file []byte, opts *PictureOptions) error`
* Change
    `func (f *File) AddTable(sheet, hCell, vCell, opts string) error`
     to
    `func (f *File) AddTable(sheet, reference string, opts *TableOptions) error`
* Change
    `func (sw *StreamWriter) AddTable(hCell, vCell, opts string) error`
     to
    `func (sw *StreamWriter) AddTable(reference string, opts *TableOptions) error`
* Change
    `func (f *File) AutoFilter(sheet, hCell, vCell, opts string) error`
     to
    `func (f *File) AutoFilter(sheet, reference string, opts *AutoFilterOptions) error`
* Change
    `func (f *File) SetPanes(sheet, panes string) error`
     to
    `func (f *File) SetPanes(sheet string, panes *Panes) error`
* Change
    `func (sw *StreamWriter) AddTable(hCell, vCell, opts string) error`
     to
    `func (sw *StreamWriter) AddTable(reference string, opts *TableOptions) error`
* Change
    `func (f *File) SetConditionalFormat(sheet, reference, opts string) error`
     to
    `func (f *File) SetConditionalFormat(sheet, reference string, opts []ConditionalFormatOptions) error`
* Add exported types:
  * AutoFilterListOptions
  * AutoFilterOptions
  * Chart
  * ChartAxis
  * ChartDimension
  * ChartLegend
  * ChartLine
  * ChartMarker
  * ChartPlotArea
  * ChartSeries
  * ChartTitle
  * ConditionalFormatOptions
  * PaneOptions
  * Panes
  * PictureOptions
  * Shape
  * ShapeColor
  * ShapeLine
  * ShapeParagraph
  * TableOptions
* This added support for set sheet visible as very hidden
* Return error when missing required parameters for set defined name
* Update unit test and comments
2022-12-30 00:50:08 +08:00
xuri bd5dd17673
This is a breaking change, remove partial internal error log print, throw XML deserialize error
- Add error return value for the `GetComments`, `GetDefaultFont` and `SetDefaultFont` functions
- Update unit tests
2022-11-12 00:16:23 +08:00
xuri a410b22bdd
Fix the error on getting the range of merged cells on the worksheet which contains one cell merged cell range
- Parse workbook default theme for custom theme color support in the feature
- Variables name typo fix
- Add system foreground and background color as RGB in the IndexedColorMapping list
2022-10-28 00:31:55 +08:00
GaoFei 3ece904b00
This closes #1369, support set, and get font color with theme and tint (#1370) 2022-10-15 00:03:49 +08:00
xuri 3d02726ad4
This closes #320, support custom chart axis font style 2022-10-14 00:48:16 +08:00
xuri 0e657c887b
This closes #1368, fixes number parsing issue, adds support for create a 3D line chart 2022-10-12 00:06:09 +08:00
xuri 53a495563a
This closes #1358, made a refactor with breaking changes, see details:
This made a refactor with breaking changes:

Motivation and Context

When I decided to add set horizontal centered support for this library to resolve #1358, the reason I made this huge breaking change was:

- There are too many exported types for set sheet view, properties, and format properties, although a function using the functional options pattern can be optimized by returning an anonymous function, these types or property set or get function has no binding categorization, so I change these functions like `SetAppProps` to accept a pointer of options structure.
- Users can not easily find out which properties should be in the `SetSheetPrOptions` or `SetSheetFormatPr` categories
- Nested properties cannot proceed modify easily

Introduce 5 new export data types:
`HeaderFooterOptions`, `PageLayoutMarginsOptions`, `PageLayoutOptions`, `SheetPropsOptions`, and `ViewOptions`

Rename 4 exported data types:
- Rename `PivotTableOption` to `PivotTableOptions`
- Rename `FormatHeaderFooter` to `HeaderFooterOptions`
- Rename `FormatSheetProtection` to `SheetProtectionOptions`
- Rename `SparklineOption` to `SparklineOptions`

Remove 54 exported types:
`AutoPageBreaks`, `BaseColWidth`, `BlackAndWhite`, `CodeName`, `CustomHeight`, `Date1904`, `DefaultColWidth`, `DefaultGridColor`, `DefaultRowHeight`, `EnableFormatConditionsCalculation`, `FilterPrivacy`, `FirstPageNumber`, `FitToHeight`, `FitToPage`, `FitToWidth`, `OutlineSummaryBelow`, `PageLayoutOption`, `PageLayoutOptionPtr`, `PageLayoutOrientation`, `PageLayoutPaperSize`, `PageLayoutScale`, `PageMarginBottom`, `PageMarginFooter`, `PageMarginHeader`, `PageMarginLeft`, `PageMarginRight`, `PageMarginsOptions`, `PageMarginsOptionsPtr`, `PageMarginTop`, `Published`, `RightToLeft`, `SheetFormatPrOptions`, `SheetFormatPrOptionsPtr`, `SheetPrOption`, `SheetPrOptionPtr`, `SheetViewOption`, `SheetViewOptionPtr`, `ShowFormulas`, `ShowGridLines`, `ShowRowColHeaders`, `ShowRuler`, `ShowZeros`, `TabColorIndexed`, `TabColorRGB`, `TabColorTheme`, `TabColorTint`, `ThickBottom`, `ThickTop`, `TopLeftCell`, `View`, `WorkbookPrOption`, `WorkbookPrOptionPtr`, `ZeroHeight` and `ZoomScale`

Remove 2 exported constants:
`OrientationPortrait` and `OrientationLandscape`

Change 8 functions:
- Change the `func (f *File) SetPageLayout(sheet string, opts ...PageLayoutOption) error` to `func (f *File) SetPageLayout(sheet string, opts *PageLayoutOptions) error`
- Change the `func (f *File) GetPageLayout(sheet string, opts ...PageLayoutOptionPtr) error` to `func (f *File) GetPageLayout(sheet string) (PageLayoutOptions, error)`
- Change the `func (f *File) SetPageMargins(sheet string, opts ...PageMarginsOptions) error` to `func (f *File) SetPageMargins(sheet string, opts *PageLayoutMarginsOptions) error`
- Change the `func (f *File) GetPageMargins(sheet string, opts ...PageMarginsOptionsPtr) error` to `func (f *File) GetPageMargins(sheet string) (PageLayoutMarginsOptions, error)`
- Change the `func (f *File) SetSheetViewOptions(sheet string, viewIndex int, opts ...SheetViewOption) error` to `func (f *File) SetSheetView(sheet string, viewIndex int, opts *ViewOptions) error`
- Change the `func (f *File) GetSheetViewOptions(sheet string, viewIndex int, opts ...SheetViewOptionPtr) error` to `func (f *File) GetSheetView(sheet string, viewIndex int) (ViewOptions, error)`
- Change the `func (f *File) SetWorkbookPrOptions(opts ...WorkbookPrOption) error` to `func (f *File) SetWorkbookProps(opts *WorkbookPropsOptions) error`
- Change the `func (f *File) GetWorkbookPrOptions(opts ...WorkbookPrOptionPtr) error` to `func (f *File) GetWorkbookProps() (WorkbookPropsOptions, error)`

Introduce new function to instead of existing functions:
- New function `func (f *File) SetSheetProps(sheet string, opts *SheetPropsOptions) error` instead of `func (f *File) SetSheetPrOptions(sheet string, opts ...SheetPrOption) error` and `func (f *File) SetSheetFormatPr(sheet string, opts ...SheetFormatPrOption
2022-09-29 22:04:50 +08:00
Artem Tarasenko 73cc4bd449
This closes #1345, support set custom line color in the charts (#1346) 2022-09-14 00:05:05 +08:00
xuri cb8bca0e92
This closes #1290 and closes #1328
- Add new smooth field in chart format parameter, support specify if smooth line chart
- Fix decimal number format round issue with build-in number format
2022-08-24 00:00:47 +08:00
NaturalGao 76f336809f
This closes #849, add new function `DeleteComment` for delete comment (#1317)
- Update unit tests for the delete comment
- Add 3 errors function for error messages
2022-08-19 23:24:13 +08:00
xuri ebea684ae5
Fix potential file corrupted and change worksheet name case-insensitive
- Using sheet ID instead of sheet index when delete the cell in calculation chain
- Update documentation for exported functions
- Using `sheet` represent the sheet name in the function parameters
2022-07-18 00:21:34 +08:00
Eng Zer Jun 6bcf5e4ede
refactor: replace strings.Replace with strings.ReplaceAll (#1250)
strings.ReplaceAll(s, old, new) is a wrapper function for
strings.Replace(s, old, new, -1). But strings.ReplaceAll is more
readable and removes the hardcoded -1.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-06-12 00:19:12 +08:00
xuri c1940c2a1e
This includes new formula functions support, dependencies upgrade, and bug fix
- Fix page setup fields parsing issue
- Go Modules dependencies upgrade
- Ref #65, CONFIDENCE.T and PHI
- Ref #1198, Fix the issue that the chart axis maximum and minimum didn't work when the value is 0
2022-04-11 00:04:00 +08:00
xuri 8a335225c7
Format code, update documentation and remove exported variable `XMLHeaderByte` 2022-03-24 00:19:30 +08:00
xuri e1d660dda7
ref #65, new formula functions: GAMMA.INV and GAMMAINV and format code 2022-03-12 00:45:27 +08:00
longphee 74b1a998d6
This closes #1172, support set hole size for doughnut (#1173) 2022-03-09 12:34:48 +08:00
xuri f0cb29cf66
This closes #1162, improve the compatibility with alternate content
Preserve alternate content in the workbook, worksheet, and drawingML
2022-03-05 14:48:34 +08:00
xuri f87c39c41d
This closes #1148, resolve limitations when adding VBA project to the workbook
Added two exported functions `SetWorkbookPrOptions` and `GetWorkbookPrOptions` to support setting and getting the code name property of the workbook
Re-order fields of the workbook properties group to improve the compatibility
Go Modules dependencies upgrade
Put workbook related operating in new `workbook.go` source code
Library introduction docs block updated
2022-02-17 00:09:11 +08:00
xuri 3ee3c38f9c
Fix file corrupted in some cases, check file extension and format code
Fix file corrupted when save as in XLAM / XLSM / XLTM / XLTX extension in some case
New exported error ErrWorkbookExt has been added, and check file extension on save the workbook
Format source code with `gofumpt`
2022-01-23 00:48:26 +08:00
xuri 2245fccca0
Typo fix, rename exported constants, dependencies modules and copyright update
Rename exported constants `NameSpaceDublinCoreMetadataIntiative` to `NameSpaceDublinCoreMetadataInitiative`
2022-01-09 00:20:42 +08:00
xuri b7fece5173
Support concurrency add picture 2021-07-06 00:31:04 +08:00
xuri 544ef18a8c
- Support concurrency iterate rows and columns
- Rename exported field `File.XLSX` to `File.Pkg`
- Exported error message
2021-07-05 00:03:56 +08:00
xuri 0e02329bed
This closes #861, support concurrency get cell picture and remove unused internal function `getSheetNameByID` 2021-07-04 12:13:06 +08:00