encharter 0.12 (development)
Bug fixes
Radar series are written with their color (line color, or the fill of a filled radar); before, Excel used its automatic colors for them.
Loaded series without a color of their own take the theme accents in turn, as the application colors them, instead of all becoming blue;
plot()does the same for series without a color.c:logBaseis written first withinc:scaling, as the schema requires. A logarithmic axis produced a chart that Excel removed on opening.Scatter and bubble series with text x values write them as a string reference (
c:strRef) instead of a number cache holding text, which made Excel repair the file.3D bar and area charts only get a series axis (
c:serAx) with the"standard"grouping. With a series axis present, a"clustered"3D column chart was rendered with its series in rows along the depth rather than side by side.Bar series are written with
<c:invertIfNegative val="0"/>unlessinvert_if_negative = TRUE. Without the element, negative bars appeared inverted (white with an outline) in Excel.
New features
encharter_load()/ec_load()read a chart from a workbook back into aChartorChartExobject, so charts can be reloaded, modified and added again. Charts written by other applications load as well. New$update_series()on both classes to change an existing series. Loading has seen limited testing; unusual charts may not survive a round trip unchanged.Chart templates:
encharter_to_crtx()/ec_to_crtx()save aChartas a chart template (.crtx),encharter_from_crtx()/ec_from_crtx()read one into aChartwhose$add_series()picks up the template’s series styling, and$apply_crtx()copies a template’s styling onto an existing chart.Loading keeps more of what a file says: deleted axes, per-series data label settings, labels and formatting of single points (
c:dLbl,c:dPt, including manual label offsets), and a fixed plot area position (c:manualLayout).render()writes all of these back.Text properties round-trip more faithfully: a chart-level default text style (
c:chartSpace/c:txPr, new field$text_style) is loaded, written and used byplot()for text without its own; the paragraph alignment of data labels (align), leader line settings (leader_lines), explicit “no fill” and “no line” of the chart and plot area ("none"), and literal categories next to referenced values are kept, as are text box insets and anchoring and the category axis label offset (label_offset). Text without an explicit size no longer getssz="1000"written, so it inherits the chart default. Axis bounds, units and cached values are written without scientific notation. Outlines of bars, areas and single points (border) and the line width of category axes are kept, and horizontal bar charts get their axes positioned left and bottom. Templates hand bar direction, grouping, overlap, gap width, outlines and label settings of their series to series added later, and$apply_crtx()copies the chart text defaults.plot()methods forChartandChartExobjects draw the chart with grid, following what a spreadsheet application renders from the written OOXML: automatic axis scaling, primary and secondary axes, tick marks, gridlines, legend, data labels, trendlines, error bars, stock charts (high-low lines, drop lines, up-down bars), pie of pie and bar of pie, the 3D column, bar, line, area and pie types and surface charts (contour and 3D, including wireframes), and the extended types waterfall, box-and-whisker, histogram, Pareto, funnel, treemap and sunburst. Region maps are not drawn; they need shape data the package does not ship. Value axes of data well away from zero start below the values, as in Excel, and date axes label the base units rather than their boundaries. Also drawn: data tables, overlaid legends, legend keys and bubble sizes in data labels, trendline intercepts, value axes crossing at the categories (cross_between = "midCat"), doughnut rings for every series and pie labels outside the slices.
encharter 0.11
CRAN release: 2026-09-05
New features
Complete coverage of the ECMA-376 plot area chart types. Newly supported:
ofPieChart(Pie of Pie / Bar of Pie, incl.barOfPiealias and$set_of_pie_options()for subtype, second plot size, and split logic) and the 3D typesbar3DChart,line3DChart,pie3DChart,area3DChart, andsurface3DChartwith a new$set_3d_options()for the 3D view (rotation, perspective, height/depth percent, right-angle axes, gap depth, bar shape).New niche axis options:
tick_lbl_skip,tick_mark_skip(category axes) anddisp_units(value axes, built-in units like"thousands"or a custom numeric unit) on allset_*_axis()methods.$set_data_label_style()gainsshow_ser_name,show_percent,show_bubble_size, and aformatnumber format string (the latter now also works for ChartEx labels).Input validation against the OOXML schema (ECMA-376 dml-chart.xsd). Values that would produce files Excel repairs or refuses to load now error at input time (e.g.
overlapoutside -100..100,gap_width> 500,marker_sizeoutside 2..72,log_baseoutside 2..1000, polynomial trendlineorderoutside 2..6). Structural problems Excel bails on despite valid XML are warned about at render time (stock charts without 3-4 series, pie types combined with axis-based types, log scale with non-positive minimum). Harmless out-of-schema values that Excel renders fine (e.g.hole_size = 0) remain accepted.Colors are validated at input time; R color names (e.g.
"red","steelblue") are now converted to hex instead of silently rendering black.ChartEx$set_waterfall_colors(increase, decrease, total)sets the semantic waterfall colors by replacing the first three entries of the chart’s color style part (colors{n}.xml), which is what waterfall maps Increase, Decrease, and Total onto. Both the bars and the legend keys reflect the colors. Accepts hex, R color names, andopenxlsx2::wb_color()including theme colors. Use a per-pointcolorvector inadd_series()for individual outliers instead.ChartEx$set_color_cycle(colors)replaces (and if needed extends) the color style part’s cycle for all extended chart types: treemap/sunburst category colors, box & whisker and histogram series, funnel and Pareto colors — bars and legend alike.ChartEx$set_region_map_colors(min, max, mid)sets a region map’s two- or three-color scale via the series’cx:valueColors.Chart options newly covered: trendline
forward/backward/intercept,error_bars$axis("x"error bars on scatter charts),invert_if_negativefor bar series, andsize_represents("area"/"w") inset_bubble_options().
Fixes
error_bars$directionwas documented but ignored (always"both"); it is now written toerrBarType.ChartEx per-point colors were written as
cx:dPtand ignored by Excel; the correct element iscx:dataPt, so passing a color vector (e.g. a corporate palette) toadd_series()now colors extended charts the same way it colors standard charts.Legend settings that are valid for standard charts no longer produce broken ChartEx XML:
pos = "tr"maps to"t"and side-stylealignvalues map onto the chartexmin/ctr/maxenum.ChartEx axes emitted
cx:spPrbefore the gridline/tick/label elements;CT_Axisplaces it aftertickLabelsandnumFmt. Excel tolerated the old order, but SDK-based validation (e.g. OOXMLValidator) flags it. Output changes for chartex axes: identical elements, schema order. A structural chartex validator driven by the Open XML SDK schema data ships ininst/tools/cx_structure_check.py.Color name resolution is delegated to
openxlsx2::wb_color()instead of a separate implementation.
