mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[PR #501] [CLOSED] Feature request: Chart secondary axes #511
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#511
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jmcnamara/libxlsxwriter/pull/501
Author: @kruftindustries
Created: 1/3/2026
Status: ❌ Closed
Base:
main← Head:master📝 Commits (5)
fc0c7bd- Added support for secondary Y axis in charts. Series can be assigned to aba04890added missing limit checks and improved tests0d02193added c99 flag to allow macros in functions with y2 axisd6e295fMerge branch 'master' of https://github.com/kruftindustries/libxlsxwriter.git1260311Fix code style and add .gitignore entry📊 Changes
509 files changed (+9035 additions, -1215 deletions)
View changed files
📝
.gitignore(+2 -1)📝
.indent.pro(+1 -0)📝
Changes.txt(+79 -3)📝
build.zig(+30 -67)📝
build.zig.zon(+1 -1)📝
dev/fuzzing/build.sh(+1 -1)➕
docs/WINDOWS_BUILD.md(+368 -0)📝
docs/src/working_with_charts.dox(+0 -7)📝
examples/chart.c(+3 -3)📝
examples/chart_area.c(+6 -6)📝
examples/chart_bar.c(+6 -6)📝
examples/chart_clustered.c(+3 -3)📝
examples/chart_column.c(+6 -6)➕
examples/chart_combined.c(+146 -0)📝
examples/chart_data_labels.c(+9 -9)📝
examples/chart_data_table.c(+4 -4)📝
examples/chart_data_tools.c(+14 -14)📝
examples/chart_doughnut.c(+4 -4)📝
examples/chart_fonts.c(+1 -1)➕
examples/chart_gauge.c(+105 -0)...and 80 more files
📄 Description
1.2.4 January 2 2026
Added support for secondary Y axis in charts. Series can be assigned to a
secondary Y axis using an optional fourth parameter to
chart_add_series().Secondary axes are accessible via the
chart->x2_axisandchart->y2_axispointers, and all existing
chart_axis_set_*()functions work with thesesecondary axis pointers. The API is backward compatible with existing code.
Added support for combined charts via
chart_combine(). Combined chartsallow overlaying two different chart types (e.g., Column + Line, Bar + Line,
Area + Column) on the same plot area. For combined charts with secondary
axes, set
chart->is_secondary = LXW_TRUEon the secondary chart.Added
chart_set_series_gap_y2()andchart_set_series_overlap_y2()to setthe gap and overlap for series on a secondary Y axis in Bar/Column charts.
Added support for Stock charts via
LXW_CHART_STOCK. Stock charts displayHigh-Low-Close (HLC) or Open-High-Low-Close (OHLC) data. Default series
formatting is applied automatically (line with no fill, appropriate markers).
Stock charts support hi-low lines, drop lines, and up-down bars.
Added
LXW_CHART_MARKER_DOTmarker type used by Stock charts.Added support for gradient fills in chart series, plotarea, and chartarea.
New functions:
chart_series_set_gradient(),chart_plotarea_set_gradient(),and
chart_chartarea_set_gradient(). Supports linear, radial, rectangular,and path gradient types with 2-10 color stops.
Added support for textboxes via
worksheet_insert_textbox()andworksheet_insert_textbox_opt(). Textboxes allow inserting text with arectangular shape into a worksheet. The optional
lxw_textbox_optionsstruct allows setting width, height, offsets, scale, and description.
Added new chart examples:
chart_stock.c: Demonstrates stock chart creation with High-Low-Close data.chart_pareto.c: Shows how to create a Pareto chart using combined Columnand Line charts with a secondary Y axis.
chart_gauge.c: Demonstrates creating a gauge chart by combining Doughnutand Pie charts with custom point colors.
chart_gradient.c: Shows how to apply gradient fills to chart seriesand the plot area.
Added
textbox.cexample demonstrating textbox insertion.Added support for sparklines via
worksheet_add_sparkline(). Sparklines aremini-charts that fit in a single cell to show data trends at a glance. The
lxw_sparkline_optionsstruct allows configuring:Added new example:
sparklines.c: Demonstrates creating different sparkline types withvarious options and custom colors.
Added support for chart date axis via
chart_axis_set_date_axis(). Thisenables date-based X axis on charts with automatic date formatting. Related
functions for configuring time units:
chart_axis_set_major_unit_type(): Set major time unit (days/months/years)chart_axis_set_minor_unit_type(): Set minor time unit (days/months/years)Added autofit helper utility functions for calculating column widths based
on string content:
lxw_pixel_width(): Calculate pixel width of a string (Calibri 11 font)lxw_autofit_width(): Calculate column width suitable forworksheet_set_column()Note: Excel does not store autofit information in files; these functions
help users calculate appropriate column widths programmatically.
Added support for inserting checkboxes in worksheet cells via
worksheet_insert_checkbox(). Checkboxes are a feature of Excel 365from 2024 onwards. They are boolean values displayed as interactive
checkboxes in cells. Added new example:
checkbox.c: Demonstrates inserting checkboxes with different states.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.