|
1 | | -The second argument of the **bindChart(chart, integrationOptions)** method allows you to customize the contents, behavior and appearance of the resulting chart. This subtopic describes those fields of this argument that consider data procession. |
| 1 | +The second argument of the **bindChart(chart, integrationOptions)** method customizes the contents, behavior, and appearance of the Chart component. This section describes the fields in this argument that handle data procession. |
2 | 2 |
|
3 | | -When binding a chart to a pivot grid, you can specify how to form chart series from grid fields. Data fields from the grid always become value fields in the chart. However, row and column fields can form either arguments or series. Use the **inverted** field to specify this. The following values are accepted by this field: |
| 3 | +When binding Chart to PivotGrid, specify how to form Chart series from PivotGrid fields. PivotGrid data fields always become Chart value fields. Row and column fields can form either arguments or series. The **inverted** field specifies the following values: |
4 | 4 |
|
5 | | -- **true** - row field values go to the arguments; column field values form series. |
6 | | -- **false** - column field values go to the arguments; row field values form series. |
| 5 | +- `true` - row field values become arguments; column field values form series. |
| 6 | +- `false` (default) - column field values become arguments; row field values form series. |
7 | 7 |
|
8 | | - --- |
9 | | - ##### jQuery |
10 | | - |
11 | | - <!--JavaScript-->pivotGridInstance.bindChart('#chartWidget', { |
12 | | - // ... |
13 | | - inverted: false // true |
14 | | - }); |
15 | | - |
16 | | - --- |
| 8 | + pivotGridInstance.bindChart(chartInstance, { |
| 9 | + // ... |
| 10 | + inverted: false // true |
| 11 | + }); |
17 | 12 |
|
18 | | -By default, the **inverted** field is set to **false**. |
19 | | - |
20 | | -In the example below, toggle the check box to change the value of the **inverted** field. When this field is **false**, values of the *"2014"* column field go to the arguments, while values of the *"Europe"* row field form series. When **inverted** is **true** - the result is inverted. |
| 13 | +In the example below, toggle the check box to update the **inverted** field. When this field is `false`, values of the *"2014"* column field become the arguments, while values of the *"Europe"* row field form series. When **inverted** is `true`, the result is reversed. |
21 | 14 |
|
22 | 15 | <div class="simulator-desktop-container" data-view="/Content/Applications/25_1/DataVisualization/Guides/GridChartIntegration/inverted.html, /Content/Applications/25_1/DataVisualization/Guides/GridChartIntegration/inverted.js"></div> |
23 | 16 |
|
24 | | -When the grid contains several data fields, they may be turned into either sets of series or sets of arguments. To specify this, set the **putDataFieldsInto** field to *"series"* or *"args"* correspondingly. By default, this property is set to *"series"*. |
25 | | - |
26 | | ---- |
27 | | -##### jQuery |
| 17 | +When PivotGrid contains multiple data fields, they can become sets of series or sets of arguments. To specify this behavior, use the **putDataFieldsInto** field and choose *"series"* (default) or *"args"*. |
28 | 18 |
|
29 | | - <!--JavaScript-->pivotGridInstance.bindChart('#chartWidget', { |
| 19 | + pivotGridInstance.bindChart(chartInstance, { |
30 | 20 | // ... |
31 | 21 | putDataFieldsInto: "series" // "args" |
32 | 22 | }); |
33 | | - |
34 | | ---- |
35 | 23 |
|
36 | | -Moreover, several data fields may either alternate on the chart plot or not. To specify this feature, set the **alternateDataFields** field to **true** or **false** respectively. By default, this property is **true**. |
| 24 | +Some data fields may alternate on the Chart plot. To control this behavior, set the **alternateDataFields** field to `true` (default) or `false`. |
37 | 25 |
|
38 | | ---- |
39 | | -##### jQuery |
40 | | - |
41 | | - <!--JavaScript-->pivotGridInstance.bindChart('#chartWidget', { |
| 26 | + pivotGridInstance.bindChart(chartInstance, { |
42 | 27 | // ... |
43 | 28 | alternateDataFields: true // false |
44 | 29 | }); |
45 | 30 |
|
46 | | ---- |
47 | | - |
48 | | -Below, use the set of controls under the UI components to change the **putDataFieldsInto** and **alternateDataFields** fields. You can observe how the *"Total"* and *"Avg"* data fields depend on the values of these fields. |
| 31 | +Below, use the controls under the UI components to change the **putDataFieldsInto** and **alternateDataFields** fields. Observe how the "Total" and "Avg" data fields depend on these values. |
49 | 32 |
|
50 | 33 | <div class="simulator-desktop-container" data-view="/Content/Applications/25_1/DataVisualization/Guides/GridChartIntegration/dataFieldsLayout.html, /Content/Applications/25_1/DataVisualization/Guides/GridChartIntegration/dataFieldsLayout.js"></div> |
51 | 34 |
|
52 | | -If you need to process data in some specific way, assign a callback function to the **processCell** field. This function will be called for each data cell of the pivot grid. |
53 | | - |
54 | | ---- |
55 | | -##### jQuery |
| 35 | +To process data in a specific way, assign a callback function to the **processCell** field. This function will be called for each data cell of PivotGrid. |
56 | 36 |
|
57 | | - <!--JavaScript-->pivotGridInstance.bindChart('#chartWidget', { |
| 37 | + pivotGridInstance.bindChart(chartInstance, { |
58 | 38 | // ... |
59 | 39 | processCell: function (cellData) { |
60 | 40 | // Process data here |
61 | 41 | return cellData; // This line is optional |
62 | 42 | } |
63 | 43 | }); |
64 | | - |
65 | | ---- |
66 | 44 |
|
67 | 45 | The **cellData** argument has the following fields: |
68 | 46 |
|
@@ -100,6 +78,4 @@ The resulting item that will be passed on to the chart data source. The fields o |
100 | 78 | * **arg**: <span style="font-size:12px">Number | String | Date</span> |
101 | 79 | The argument of the data item. |
102 | 80 | * **val**: <span style="font-size:12px">Number | String | Date</span> |
103 | | - The value of the data item. |
104 | | - |
105 | | -In this topic, you have discovered how to process data coming from PivotGrid to Chart using the second argument of the [bindChart(chart, integrationOptions)](/api-reference/10%20UI%20Components/dxPivotGrid/3%20Methods/bindChart(chart_integrationOptions).md '/Documentation/ApiReference/UI_Components/dxPivotGrid/Methods/#bindChartchart_integrationOptions') method. The final topic provides an overview of fields that customize the resulting look of Chart. |
| 81 | + The value of the data item. |
0 commit comments