Skip to content

Commit f019aab

Browse files
authored
Merge pull request #11 from DHTMLX/next
Updates for v8.4
2 parents 21a6027 + 402c24f commit f019aab

File tree

236 files changed

+1942
-920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+1942
-920
lines changed
23.2 KB
Loading
16.2 KB
Loading
40.5 KB
Loading

docs/chart/api/chart_data_config.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ description: You can explore the data config of Chart in the documentation of th
88

99
@short: Optional. Specifies an array of data objects to set into the chart
1010

11+
:::info
12+
Please note that if you specify the `id` fields in the data collection, their values should be **unique**. You can also omit the `id` fields in the data collection. In this case they will be generated automatically.
13+
:::
14+
1115
@signature: {'data?: object[];'}
1216

1317
@example:

docs/chart/api/chart_series_config.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ series: [
249249
strokeWidth?: number,
250250
subType?: "basic" | "percentOnly" | "valueOnly",
251251
useLines?: boolean,
252+
valueTemplate?: (value: number) => string
252253
}
253254
]
254255
~~~
@@ -299,12 +300,16 @@ series: [
299300
</tr>
300301
<tr>
301302
<td><b>subType</b></td>
302-
<td>(optional) specifies the subtype of a chart: "basic"|"percentOnly"|"valueOnly"</td>
303+
<td>(optional) specifies the subtype of a chart: "basic" | "percentOnly" | "valueOnly"</td>
303304
</tr>
304305
<tr>
305306
<td><b>useLines</b></td>
306307
<td>(optional) shows/hides lines used to "connect" chart sectors with labels</td>
307308
</tr>
309+
<tr>
310+
<td><b>valueTemplate</b></td>
311+
<td>(optional) a function that specifies the template for rendering the values for data items on a chart<br/><br><b>Related Sample: </b><a href="https://snippet.dhtmlx.com/77aei7os?tag=chart" target="_blank">Chart. Value template</a> </td>
312+
</tr>
308313
</tbody>
309314
</table>
310315
<br><br>

docs/chart/api/export/chart_pdf_method.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ description: You can explore the pdf method of Chart in the documentation of the
3939
- `title` - (optional) document name
4040
- `pageNumber` - (optional) current page number
4141
- `totalPages` - (optional) total pages in the document
42+
- `header?: string` - (optional) an HTML template for the header in the exported file
43+
- `footer?: string` - (optional) an HTML template for the footer in the exported file
4244

4345

4446
@example:
@@ -78,7 +80,8 @@ It is necessary to set sufficient margin for correct display of `headerTemplate`
7880
**Related API:** [exportStyles](chart/api/chart_exportstyles_config.md)
7981

8082
**Change log:**
83+
- The **header** and **footer** options of the export object were added in v8.4
8184
- The **theme**, **exportStyles** options of the export object were added in v8.1
82-
- The **pageRanges**, **displayHeaderFooter**, **footerTemplate**, **headerTemplate** options of the pdf object were added in 8.1
83-
- The method was added in v8.0
85+
- The **pageRanges**, **displayHeaderFooter**, **footerTemplate**, **headerTemplate** options of the pdf object were added in v8.1
86+
- Added in v8.0
8487

docs/chart/api/export/chart_png_method.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ description: You can explore the png method of Chart in the documentation of the
1616
- `name?: string` - (optional) the name of the exported file
1717
- `theme?: string` - (optional) the exported theme, "light" by default. For custom or overridden themes, enable the `exportStyles` option
1818
- `exportStyles?: boolean | string[]` - (optional) defines the styles that will be sent to the export service when exporting Chart. Use *false* to prevent all styles from being sent to the export service
19+
- `header?: string` - (optional) an HTML template for the header in the exported file
20+
- `footer?: string` - (optional) an HTML template for the footer in the exported file
1921

2022
@example:
2123
// default export
@@ -34,5 +36,7 @@ chart.export.png({
3436
**Related API:** [exportStyles](chart/api/chart_exportstyles_config.md)
3537

3638
**Change log:**
39+
40+
- The **header** and **footer** options of the export object were added in 8.4
3741
- The **theme** and **exportStyles** options of the export object were added in 8.1
38-
- The method was added in v8.0
42+
- Added in v8.0

docs/chart/customization.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ const chart = new dhx.Chart("chart_container", {
201201

202202
**Related sample**: [Chart. Show text](https://snippet.dhtmlx.com/o7ke2f1s)
203203

204-
The **showTextTemplate** option of [series](chart/configuration_properties.md#series) lets you an opportunity to add a template to values that are shown for data items in bars:
204+
The **showTextTemplate** option of [series](chart/configuration_properties.md#series) allows you to add a template to values that are shown for data items in bars:
205205

206206
~~~js {20-22,29-31}
207207
const chart = new dhx.Chart("chart_container", {
@@ -245,3 +245,25 @@ const chart = new dhx.Chart("chart_container", {
245245
}
246246
});
247247
~~~
248+
249+
## Adding template to values of data items in Pie and Donut charts
250+
251+
![](../assets/chart/show_percent_values.png)
252+
253+
**Related sample**: [Chart. Value template](https://snippet.dhtmlx.com/o7ke2f1s)
254+
255+
When you need to show values for data items on the Pie, Pie3D and Donut charts, you can use the **valueTemplate** option of [series](chart/configuration_properties.md#the-list-of-config-options-for-series-for-charts-without-scales-pie-pie3d-donut) to specify the necessary template function. For example:
256+
257+
~~~jsx {6-8}
258+
const chart = new dhx.Chart("chart_container", {
259+
type: "pie",
260+
series: [
261+
{
262+
value: "value",
263+
valueTemplate: value => {
264+
return (value * 100).toFixed(2) + "%";
265+
}
266+
}
267+
]
268+
});
269+
~~~

docs/chart/data_loading.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ First, you need to prepare a data set that will be loaded into Chart.
1515

1616
## Preparing data set
1717

18-
DHTMLX Chart expects loaded data in the JSON format. Here are examples of appropriate data sets for different chart types:
18+
DHTMLX Chart expects loaded data in the JSON format.
19+
20+
:::info
21+
Please note that if you specify the `id` fields in the data collection, their values should be **unique**. You can also omit the `id` fields in the data collection. In this case they will be generated automatically.
22+
:::
23+
24+
Here are examples of appropriate data sets for different chart types:
1925

2026
- **Line, Spline, Bar, X-Bar, Area, Spline Area, Radar, Scatter charts**
2127

@@ -46,7 +52,7 @@ A data set for Pie, Pie3D and Donut charts differs a little bit and includes the
4652
<tbody>
4753
<tr>
4854
<td><b>id</b></td>
49-
<td>(<i>string, number</i>) the id of a series </td>
55+
<td>(<i>string | number</i>) the id of a series</td>
5056
</tr>
5157
<tr>
5258
<td><b>key:value</b></td>
@@ -84,7 +90,7 @@ A data set for Treemap chart has also another structure and may include the foll
8490
<tbody>
8591
<tr>
8692
<td><b>id</b></td>
87-
<td>(<i>string, number</i>) the id of a tile or group</td>
93+
<td>(<i>string | number</i>) the id of a tile or group</td>
8894
</tr>
8995
<tr>
9096
<td><b>key:value</b></td>
@@ -122,7 +128,7 @@ A data set for Heatmap chart should include the following properties:
122128
<tbody>
123129
<tr>
124130
<td><b>id</b></td>
125-
<td>(<i>string, number</i>) the id of a cell</td>
131+
<td>(<i>string | number</i>) the id of a cell</td>
126132
</tr>
127133
<tr>
128134
<td><b>key:value</b></td>

docs/combobox/adding_options.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ First, you need to prepare a data set that will be loaded into Combo.
1515

1616
## Preparing data set
1717

18-
DHTMLX Combo expects loaded data in the JSON format. Here is an example of an appropriate data set:
18+
DHTMLX Combo expects loaded data in the JSON format.
19+
20+
:::info
21+
Please note that if you specify the `id` fields in the data collection, their values should be **unique**. You can also omit the `id` fields in the data collection. In this case they will be generated automatically.
22+
:::
23+
24+
Here is an example of an appropriate data set:
1925

2026
~~~js
2127
const dataset = [

0 commit comments

Comments
 (0)