Qu

pptx.add_chart

Builtin index · File I/O

pptx.add_chart(p, i, 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], [shape_name=])

Input: p, i, 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, shape_name · Output: no output

What it is

Adds a native, scalable PowerPoint chart to slide i from numbers given directly (a vector or a table column such as data.z); returns the new shape's id. kind is "scatter" (XY, both axes numeric), "line", "bar" (vertical) or "barh" (horizontal). y is a vector for one series, or several series as a parenthesised list (a, b) of vectors or a matrix with one column per series (a bracketed [[..], [..]] is flattened by Qu itself into one vector, so give names= to catch that). x= is one vector shared by all series (x values for scatter, categories for line/bar -- a list of strings gives text labels) or a list with one per series. names=/colors= go one per series (colours by name or #rrggbb, default Qu's plot palette). at=[x, y] is the top-left corner (millimetres or lengths; default: centred on the slide); width/height in millimetres or lengths. Scatter draws markers only (lines=true joins them), 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. The numbers are stored in the chart as cached literals, not in an embedded workbook: it renders everywhere with exactly the data given, but PowerPoint's "Edit Data" has no sheet to open -- build a chart that must stay editable with xlsx.add_chart. Only the slide, its relationships, [Content_Types].xml and the new chart part change. *Added in v0.4.7*

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
pptx.add_chart(p, i, 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], [shape_name=])
p —not documented yet
i number or vectorAdds a native, scalable PowerPoint chart to slide i from numbers given directly (a vector or a table column such as data.z).
kind —kind is "scatter" (XY, both axes numeric), "line", "bar" (vertical) or "barh" (horizontal).
y vector or matrixy is a vector for one series, or several series as a parenthesised list (a, b) of vectors or a matrix with one column per series (a bracketed [[..], [..]] is flattened by Qu itself into one vector, so give names= to catch that).
x vector or string, optionalx= is one vector shared by all series (x values for scatter, categories for line/bar -- a list of strings gives text labels) or a list with one per series.
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=[x, y] is the top-left corner (millimetres or lengths.
width optional (default 160)width/height in millimetres or lengths.
height optional (default 90)width/height in millimetres or lengths.
lines optionalScatter draws markers only (lines=true joins them), line charts lines only.
markers optionalScatter draws markers only (lines=true joins them), 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.
shape_name optionalnot documented yet
not documented yetThe numbers are stored in the chart as cached literals, not in an embedded workbook: it renders everywhere with exactly the data given, but PowerPoint's "Edit Data" has no sheet to open -- build a chart that must stay editable with xlsx.add_chart. Only the slide, its relationships, [Content_Types].xml and the new chart part change. *Added in v0.4.7*.

Examples

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