Qu

xlsx.add_chart

Builtin index · File I/O

xlsx.add_chart(wb, sheet, kind, y, [x=], [names=], [colors=], [title=], [x_title=], [y_title=], [at=], [width=160], [height=90], [lines=], [markers=], [legend=], [x_min=], [x_max=], [y_min=], [y_max=], [x_log=false], [y_log=false], [equal_axes=false])

Input: wb, sheet, kind, y, x, names, colors, title, x_title, y_title, at, width, height, lines, markers, legend, x_min, x_max, y_min, y_max, x_log, y_log, equal_axes · Output: no output

What it is

Adds a native Excel chart that refers to the cells, so it follows later edits in Excel/LibreOffice. kind is "scatter" (XY, both axes numeric), "line", "bar" (vertical) or "barh" (horizontal). y is a range string ("B2:B40", "Data!B2:B40") or a list of them, one series each; x= is one range shared by all series or one per series (x values for scatter, category labels for line/bar). names=/colors= go one per series (colours by name or #rrggbb, default Qu's plot palette). at= is the top-left cell (default: two columns right of the used range, row 2); width/height in millimetres or lengths. Scatter draws lines and markers by default (lines=false for points only), line charts lines only. Axis limits, log scales and equal_axes=true (one unit the same length along both axes) are scatter-only. A legend appears when there are several series or names.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
xlsx.add_chart(wb, sheet, kind, y, [x=], [names=], [colors=], [title=], [x_title=], [y_title=], [at=], [width=160], [height=90], [lines=], [markers=], [legend=], [x_min=], [x_max=], [y_min=], [y_max=], [x_log=false], [y_log=false], [equal_axes=false])
wb —not documented yet
sheet —not documented yet
kind —kind is "scatter" (XY, both axes numeric), "line", "bar" (vertical) or "barh" (horizontal).
y stringy is a range string ("B2:B40", "Data!B2:B40") or a list of them, one series each.
x optionalx= is one range shared by all series or one per series (x values for scatter, category labels for line/bar).
names optionalnames=/colors= go one per series (colours by name or #rrggbb, default Qu's plot palette).
colors optionalnames=/colors= go one per series (colours by name or #rrggbb, default Qu's plot palette).
title optionalnot documented yet
x_title optionalnot documented yet
y_title optionalnot documented yet
at optionalat= is the top-left cell (default: two columns right of the used range, row 2).
width optional (default 160)width/height in millimetres or lengths.
height optional (default 90)width/height in millimetres or lengths.
lines optionalScatter draws lines and markers by default (lines=false for points only), line charts lines only.
markers optionalScatter draws lines and markers by default (lines=false for points only), line charts lines only.
legend optionalA legend appears when there are several series or names.
x_min optionalnot documented yet
x_max optionalnot documented yet
y_min optionalnot documented yet
y_max optionalnot documented yet
x_log optional (default false)not documented yet
y_log optional (default false)not documented yet
equal_axes optional (default false)Axis limits, log scales and equal_axes=true (one unit the same length along both axes) are scatter-only.
no outputAdds a native Excel chart that refers to the cells, so it follows later edits in Excel/LibreOffice.

Examples

No documentation example calls this form yet. The File I/O chapter is where one belongs.