xlsx.add_chart
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.
| Code | Input | Output | Description |
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 yetsheet —not documented yetkind —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 yetx_title optionalnot documented yety_title optionalnot documented yetat 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 yetx_max optionalnot documented yety_min optionalnot documented yety_max optionalnot documented yetx_log optional (default false)not documented yety_log optional (default false)not documented yetequal_axes optional (default false)Axis limits, log scales and equal_axes=true (one unit the same length along both axes) are scatter-only. | no output | Adds 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.