Skip to content

Commit ab4e812

Browse files
authored
Update docs for the AddChart function (#2)
- Add show_data_table and show_data_table_keys fields in the ChartPlotArea class - Add font field in the ChartLegend class - Add legend field in the ChartSeries class
1 parent 854adde commit ab4e812

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

en/chart.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ name | Legend item (series), displayed in the chart legend and fo
7878
categories | Horizontal (category) axis label. The `categories` parameter is optional in most chart types, the default is a contiguous sequence of the form `1..n`.
7979
values | The chart data area, which is the most important parameter in `series`, is also the only required parameter when creating a chart. This option links the chart to the worksheet data it displays.
8080
fill | This sets the format for the data series fill.
81+
legend | This set the font of legend text for a data series. The `legend` property is optional.
8182
line | This sets the line format of the line chart. The `line` property is optional and if it isn't supplied it will default style. The options that can be set is `width`. The range of `width` is 0.25pt - 999pt. If the value of width is outside the range, the default width of the line is 2pt.
8283
marker | This sets the marker of the line chart and scatter chart. The range of the optional field `size` is 2-72 (default value is `5`). The enumeration value of optional field `symbol` are (default value is `auto`): `circle`, `dash`, `diamond`, `dot`, `none`, `picture`, `plus`, `square`, `star`, `triangle`, `x` and `auto`.
8384
data_label_position | This sets the position of the chart series data label.
@@ -88,6 +89,7 @@ Parameter|Type|Explanation
8889
---|---|---
8990
position | `str` | The position of the chart legend
9091
show_legend_key | `bool` | Set the legend keys shall be shown in data labels
92+
font | `Font` | Set the font properties of the chart legend text. The properties that can be set are the same as the font object that is used for cell formatting. The font family, size, color, bold, italic, underline, and strike properties can be set
9193

9294
Set the `position` of the chart legend. The default legend position is `right`. This parameter only takes effect when `none` is `False`. The available positions are:
9395

@@ -100,7 +102,7 @@ left | On left
100102
right | On right
101103
top_right | On top right
102104

103-
The `ShowLegendKey` parameter set the legend keys shall be shown in data labels. The default value is `false`.
105+
The `show_legend_key` parameter set the legend keys shall be shown in data labels. The default value is `False`.
104106

105107
The chart title is set by selecting the `name` parameter of the `title` object, and the title will be displayed above the chart. The parameter `name` supports the use of formula representations, such as `Sheet1!$A$1`, if you do not specify an icon title, the default value is null.
106108

@@ -112,6 +114,8 @@ gap | Space
112114
span | Connect data points with straight lines
113115
zero | Zero value
114116

117+
Set chart legend for all data series by `legend` property. The `legend` property is optional.
118+
115119
Set the bubble size in all data series for the bubble chart or 3D bubble chart by `bubble_sizes` property. The `bubble_sizes` property is optional. The default width is `100`, and the value should be great than 0 and less or equal than 300.
116120

117121
Set the doughnut hole size in all data series for the doughnut chart by `hole_size` property. The `hole_size` property is optional. The default width is `75`, and the value should be great than 0 and less or equal than 90.
@@ -124,14 +128,16 @@ Set the position of the chart plot area by plot area. The properties that can be
124128

125129
Parameter|Type|Default|Explanation
126130
---|---|---|---
127-
second_plot_values | `int` | `0` | Specifies the values in second plot for the `PieOfPie` and `BarOfPie` chart.
128-
show_bubble_size | `bool` | `False` | Specifies the bubble size shall be shown in a data label.
129-
show_cat_name | `bool` | `True` | Category name.
130-
show_leader_lines | `bool` | `False` | Specifies that the category name shall be shown in the data label.
131-
show_percent | `bool` | `False` | Specifies that the percentage shall be shown in a data label.
132-
show_ser_name | `bool` | `False` | Specifies that the series name shall be shown in a data label.
133-
show_val | `bool` | `False` | Specifies that the value shall be shown in a data label.
134-
num_fmt | `ChartNumFmt` | N/A | Specifies that if linked to source and set custom number format code for data labels. The `num_fmt` property is optional. The default format code is `General`.
131+
second_plot_values | `int` | `0` | Specifies the values in second plot for the `PieOfPie` and `BarOfPie` chart.
132+
show_bubble_size | `bool` | `False` | Specifies the bubble size shall be shown in a data label.
133+
show_cat_name | `bool` | `True` | Specifies that the category name shall be shown in the data label. The `show_cat_name` property is optional.
134+
show_data_table | `bool` | `False` | Used for add data table under chart, depending on the chart type, only available for area, bar, column and line series type charts.
135+
show_data_table_keys | `bool` | `False` | Used for add legend key in data table, only works on `show_data_table` is enabled. The `show_data_table_keys` property is optional.
136+
show_leader_lines | `bool` | `False` | Specifies that the category name shall be shown in the data label.
137+
show_percent | `bool` | `False` | Specifies that the percentage shall be shown in a data label.
138+
show_ser_name | `bool` | `False` | Specifies that the series name shall be shown in a data label.
139+
show_val | `bool` | `False` | Specifies that the value shall be shown in a data label.
140+
num_fmt | `ChartNumFmt` | N/A | Specifies that if linked to source and set custom number format code for data labels. The `num_fmt` property is optional. The default format code is `General`.
135141

136142
Set the primary horizontal and vertical axis options by `x_axis` and `y_axis`.
137143

en/workbook.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Set worksheet properties. The properties that can be set are:
224224
Options|Type|Description
225225
---|---|---
226226
code_name | `Optional[str]` | Specifies a stable name of the sheet, which should not change over time, and does not change from user input. This name should be used by code to reference a particular sheet
227-
enable_format_conditions_calculation | `Optional[bool]` | Indicating whether the conditional formatting calculations shall be evaluated. If set to false, then the min/max values of color scales or data bars or threshold values in Top N rules shall not be updated. Essentially the conditional formatting "calc" is off
227+
enable_format_conditions_calculation | `Optional[bool]` | Indicating whether the conditional formatting calculations shall be evaluated. If set to False, then the min/max values of color scales or data bars or threshold values in Top N rules shall not be updated. Essentially the conditional formatting "calc" is off
228228
published | `Optional[bool]` | Indicating whether the worksheet is published, the default value is `True`
229229
auto_page_breaks | `Optional[bool]` | Indicating whether the sheet displays Automatic Page Breaks, the default value is `True`
230230
fit_to_page | `Optional[bool]` | Indicating whether the Fit to Page print option is enabled, the default value is `False`
@@ -314,7 +314,7 @@ Sets sheet view properties. The `view_index` may be negative and if so is counte
314314
Options|Type|Description
315315
---|---|---
316316
default_grid_color | `Optional[bool]` | Indicating that the consuming application should use the default grid lines color(system dependent). Overrides any color specified in colorId, the default value is `True`
317-
right_to_left | `Optional[bool]` | Indicating whether the sheet is in "right to left" display mode. When in this mode, Column A is on the far right, Column B; is one column left of Column A, and so on. Also, information in cells is displayed in the Right to Left format, the default value is `false`
317+
right_to_left | `Optional[bool]` | Indicating whether the sheet is in "right to left" display mode. When in this mode, Column A is on the far right, Column B; is one column left of Column A, and so on. Also, information in cells is displayed in the Right to Left format, the default value is `False`
318318
show_formulas | `Optional[bool]` | Indicating whether this sheet should display formulas, the default value is `False`
319319
show_grid_lines | `Optional[bool]` | Indicating whether this sheet should display grid lines, the default value is `True`
320320
show_row_col_headers | `Optional[bool]` | Indicating whether the sheet should display row and column headings, the default value is `True`

0 commit comments

Comments
 (0)