Skip to content

Commit 9cd0416

Browse files
authored
Merge pull request #9149 from gjulivan/development
update charts documentation
2 parents 55ed214 + 8e2ee5e commit 9cd0416

10 files changed

Lines changed: 169 additions & 31 deletions

File tree

content/en/docs/appstore/use-content/platform-supported-content/modules/any-chart.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
---
22
title: "Any Chart"
33
url: /appstore/modules/any-chart/
4+
deprecated: true
45
description: "Describes the configuration and usage of the Any Chart module, which is available in the Mendix Marketplace."
56
#If moving or renaming this doc file, implement a temporary redirect and let the respective team know they should update the URL in the product. See Mapping to Products for more details.
67
---
78

89
## Introduction
910

11+
{{% alert color="warning" %}}
12+
This widget is not compatible with the [Mendix React Client](/refguide/mendix-client/react/). We have published a version of Any Chart that supports the React client called Custom Chart. Update your [Charts](/appstore/widgets/charts/) widget (to version 6.0 or above) to use the Custom Chart feature.
13+
{{% /alert %}}
14+
1015
The [Any Chart](https://marketplace.mendix.com/link/component/106517/) module contains chart types supported in [plotly.js version 2.35.2](https://www.npmjs.com/package/plotly.js/v/2.35.2).
1116

1217
Further documentation on usage can be found in the following pages locations:

content/en/docs/appstore/use-content/platform-supported-content/widgets/charts/_index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ For more examples of what Charts widgets can do, see the following documents:
1313

1414
* [Create a Basic Chart](/appstore/widgets/charts-basic-create/)
1515
* [Use Any Chart](/appstore/widgets/charts-any-usage/)
16-
* [Fine-Tune a Chart with Advanced Settings](/appstore/widgets/chart-advanced-tuning/)
16+
* [Use Custom Chart](/appstore/widgets/charts-custom-usage/)
17+
* [Fine-Tune a Chart with Chart Playground](/appstore/widgets/chart-advanced-tuning/)
1718
* [Use the Charts Theme](/appstore/widgets/charts-theme/)
1819
* [Create a Dynamic Series Chart](/appstore/widgets/charts-dynamic-series/)
1920
* [Use a Chart with a REST Data Source](/appstore/widgets/charts-basic-rest/)
@@ -75,7 +76,7 @@ Beside the **General** tab you will find 3 more tabs in the **Edit Series** dial
7576
All changes made in the developer editor are temporary. To save your progress, copy the settings from the **Custom settings** area to the **Chart settings** in Studio Pro.
7677
{{% /alert %}}
7778

78-
When set to **Yes** this property enables **Developer mode** for the selected chart. After enabling **Developer mode** you will see a **Toggle Editor** button. When clicked, this button opens the **Chart settings** panel:
79+
See [Fine-Tune chart](/appstore/widgets/chart-advanced-tuning/) documentation to enable this.
7980

8081
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/toggle-editor-button.png" width="350px" alt="Toggle Editor button in top right corner of the chart widget." class="no-border" >}}
8182

content/en/docs/appstore/use-content/platform-supported-content/widgets/charts/charts-advanced-tuning.md

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Fine-Tune a Chart with Advanced Settings"
2+
title: "Fine-Tune a Chart with Chart Playground"
33
linktitle: "Chart Advanced Tuning"
44
url: /appstore/widgets/chart-advanced-tuning/
55
weight: 30
@@ -10,21 +10,25 @@ aliases:
1010

1111
## Introduction
1212

13-
The individual Charts widgets can be fine-tuned with advanced settings. The settings can affect the layout, configuration and data.
13+
The individual charts widgets can be fine-tuned using a **Chart Playground** widget. The settings can affect the layout, configuration, and data.
1414

15-
This how-to teaches you how to do the following:
15+
{{% alert color="info" %}}
16+
The **Chart Playground** widget is included in [Charts Widget](/appstore/widgets/charts/). It replaces developer mode in Charts Widget versions 5 and higher.
17+
{{% /alert %}}
18+
19+
This guide teaches you how to do the following:
1620

1721
* Change font style (layout)
1822
* Change chart type (data series)
1923
* Enable toolbar (configuration)
2024

2125
## Prerequisites
2226

23-
Before starting this how-to, make sure you have completed the following prerequisites:
27+
Before starting this guide, make sure you have completed the following prerequisites:
2428

2529
* Installed the latest version of Mendix Studio Pro
26-
* Downloaded the latest [Chart Widget](/appstore/widgets/charts/) from the Mendix Marketplace
27-
* Set up a chart, see [How to Create a Chart](/howto/front-end/charts-basic-create/)
30+
* Downloaded the latest [Charts Widget](/appstore/widgets/charts/) from the Mendix Marketplace
31+
* Set up a chart by using [How to Create a Chart](/howto/front-end/charts-basic-create/)
2832

2933
## Changing the Layout {#layout-changes}
3034

@@ -35,15 +39,16 @@ This is what the original chart looks like:
3539
To create a custom layout, follow these steps:
3640

3741
1. Open an app containing a chart.
38-
2. Open the page with the charts widget.
39-
3. Open the charts widget settings.
40-
4. Go to the tab **Advanced**.
41-
5. Set the **Mode** to **Developer**.
42-
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-advanced-tuning/charts-widget-properties-advanced.png" alt="chart properties" class="no-border" >}}
43-
6. Run the app.
44-
7. In your browser, open the page with the chart.
45-
8. Click the button **Toggle Editor**.
46-
9. In the **Layout** section add the following **Custom setting**:
42+
1. Open the page with the charts widget.
43+
1. Open the charts widget's settings.
44+
1. Click the **General** tab.
45+
1. Set **Show playground slot** to **Yes**. If you check, you can see the widget **Playground slot** drop zone area is now visible in the chart.
46+
1. Find the **Chart playground** widget in **Toolbox**.
47+
1. Drag and drop the **Chart playground** widget onto the available **Playground slot**.
48+
1. Run the app.
49+
1. In your browser, open the page with the chart.
50+
1. Click the button **Toggle Editor**.
51+
1. In the **Layout** section add the following **Custom setting**:
4752

4853
```json
4954
{
@@ -55,23 +60,16 @@ To create a custom layout, follow these steps:
5560
}
5661
```
5762

58-
10. Change the font settings till the chart shows the required font. Copy the font settings.
63+
1. Change the font settings until the chart shows the required font. Copy the font settings:
5964

6065
{{% alert color="warning" %}}Please note that changes made in the editor will not persist unless they are stored in the advanced settings of the widget or in the theme.{{% /alert %}}
6166

6267
After making some changes, the chart looks like this:
6368

6469
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-advanced-tuning/charts-toggle-editor-open.png" alt="chart editor" class="no-border" >}}
6570

66-
11. Paste the new font settings into the **Layout options** property in the **Advanced** tab.
67-
68-
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-advanced-tuning/charts-widget-properties-advanced-layout.png" alt="chart editor" class="no-border" >}}
69-
70-
12. Change the **Mode** back to **Advanced** in Studio Pro, this will remove the Toggle Editor button from the chart.
71-
72-
{{% alert color="warning" %}}
73-
Please note that the advanced settings only apply to the chart in Advanced or Developer mode.
74-
{{% /alert %}}
71+
1. Paste the new font settings into the **Custom layout** property in the **Advanced** tab.
72+
1. Change the **Show playground slot** back to **No** in Studio Pro, this will remove the Toggle Editor button from the chart.
7573

7674
## Changing the Chart Type
7775

@@ -81,7 +79,7 @@ This is what the chart looks like before making any changes:
8179

8280
To create a custom configuration, follow these steps:
8381

84-
1. Repeat steps 1 to 8 from the [layout instructions](#layout-changes).
82+
1. Repeat steps 1 to 11 from the [layout instructions](#layout-changes).
8583
2. Select the name of the series you want to display differently from the drop-down menu: in this case **Series 1**.
8684
3. Edit the **Custom settings**; change them to `{ "type": "line" }`.
8785
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-advanced-tuning/charts-widget-bar-line-combination.png" alt="chart editor" class="no-border" >}}
@@ -99,7 +97,7 @@ After the changes, the chart looks like this:
9997

10098
To create custom a configuration, follow these steps:
10199

102-
1. Repeat steps 1 to 8 from the [layout instructions](#layout-changes).
100+
1. Repeat steps 1 to 11 from the [layout instructions](#layout-changes).
103101
2. Select **Configuration** from the drop-down menu.
104102
3. Edit the **Custom settings**, change them to `{ "displayModeBar": true }`.
105103
4. Add more Custom settings as desired. See [here](https://plot.ly/javascript/configuration-options/) for more configuration settings.

content/en/docs/appstore/use-content/platform-supported-content/widgets/charts/charts-any-usage.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
---
22
title: "Use Any Chart"
33
url: /appstore/widgets/charts-any-usage/
4+
deprecated: true
45
weight: 20
56
description: "How to use the Any Chart widget to create advanced charts"
67
aliases:
78
- /howto/front-end/charts-any-usage/
89
---
910

11+
{{% alert color="warning" %}}
12+
This widget is not compatible with the [Mendix React Client](/refguide/mendix-client/react/). We have published a version of Any Chart that supports the React client called Custom Chart. Update your [Charts](/appstore/widgets/charts/) widget (to version 6.0 or above) to use the Custom Chart feature.
13+
{{% /alert %}}
14+
1015
## Introduction
1116

1217
The basic charts provide a set of easy to configure charts such as line, bar, column, pie, and so forth. These charts can be fine tuned with the advanced options.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
title: "Use Custom Chart"
3+
url: /appstore/widgets/charts-custom-usage/
4+
weight: 20
5+
description: "How to use the Custom Chart widget to create advanced charts"
6+
aliases:
7+
- /howto/front-end/charts-custom-usage/
8+
---
9+
10+
## Introduction
11+
12+
The basic charts provide a set of easy to configure charts such as line, bar, column, pie, and so forth. These charts can be fine tuned with the advanced options.
13+
14+
When the advanced options are not enough, starting from charts version 6.0 and higher, the **Custom Chart** widget can be used.
15+
16+
With **Custom Chart** you can build all the chart types that are possible with Plotly.js as well as options for configuring charts dynamically. So, if you want to build a 3D chart or have a dynamic set of series, **Custom Chart** is your friend.
17+
**Custom Chart** is a successor of **Any Chart** module that is compatible with **React client** mode.
18+
19+
This how-to teaches you how to do the following:
20+
21+
* Create a line chart with sample data
22+
* Export data for a chart
23+
* Fine tune the chart with the run-time playground
24+
25+
## Prerequisites
26+
27+
Before starting this how-to, make sure you have the following prerequisites:
28+
29+
* The latest version of Mendix Studio Pro
30+
* The latest [Chart](/appstore/widgets/charts/) widget
31+
* An understanding of JSON data structures
32+
33+
## Chart Structure
34+
35+
A **Custom Chart** widget can be configured with a JSON **Data** array and **Layout** object. The configuration can be set statically, via the **Source attribute** or with the **Sample data**.
36+
37+
The configuration in the **Source attribute** will be merged into the static settings and will overwrite any common properties. The **Sample data** is for demo purposes at run time when there is no **Source** attribute selected or when rendering sample data in the Studio Pro preview.
38+
39+
## Creating a Chart
40+
41+
To create a line chart with the **Custom Chart** widget, follow these steps:
42+
43+
1. Create a page with a data view (Chart context).
44+
2. Add the Custom Chart widget in the data view.
45+
3. Select the line chart sample from the [Any Chart cheat sheet](/refguide/charts-any-cheat-sheet/#line-chart):
46+
47+
```json
48+
[ { "x": [ 1, 2 ], "y": [ 1, 2 ], "type": "scatter" } ]
49+
```
50+
51+
4. In Studio Pro, copy the data into the Custom Chart widget property tab **Data**, field **Static**.
52+
5. Run the app to confirm the chart renders correctly.
53+
6. Split the data into static and dynamic parts that are going to be generated from the domain model.
54+
55+
Static :
56+
57+
```json
58+
[ { "type": "scatter" } ]
59+
```
60+
61+
Sample data :
62+
63+
```json
64+
[ { "x": [ 1, 2 ], "y": [ 1, 2 ] } ]
65+
```
66+
67+
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-any-usage/any-chart-configuration.png" alt="Any Chart Configuration" class="no-border" >}}
68+
69+
7. Run the app to preview the chart.
70+
71+
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-any-usage/charts-any-sample.png" alt="Any Chart result" class="no-border" >}}
72+
73+
## Exporting Data
74+
75+
To generate JSON data for the Charts widget, follow these steps:
76+
77+
1. Add a **Data** string (unlimited length) attribute to the Chart (context) entity.
78+
2. In the widget, set the **Source attribute** field in the **Data** tab.
79+
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-any-usage/custom-chart-configuration-attribute.png" alt="Select data attribute" class="no-border" >}}
80+
3. Create a **JSON Structure** and use the **Sample data** as the snippet.
81+
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-any-usage/any-chart-json-structure-line-chart-data.png" alt="Create export mapping" class="no-border" >}}
82+
4. Create an **Export Mapping** with the **JSON Structure**.
83+
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-any-usage/any-chart-line-chart-export-mapping-select.png" alt="Select data structure" class="no-border" >}}
84+
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-any-usage/any-chart-line-chart-export-mapping.png" alt="Map objects" class="no-border" >}}
85+
5. Create a microflow that retrieves the data.
86+
6. Use the **Export Mapping** to generate a **String Variable**. Store the value in the object attribute that is selected as **Source attribute**.
87+
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-any-usage/any-chart-export-microflow.png" alt="Export microflow" class="no-border" >}}
88+
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-any-usage/any-chart-export-microflow-structure.png" alt="Export microflow" class="no-border" >}}
89+
90+
If need be, the layout can also be generated in the same way as the data. In most cases, a **Static** layout will suffice.
91+
92+
## Fine tuning
93+
94+
Editing the JSON configuration in Studio Pro can be cumbersome. With the live preview editor, developers can directly see the output of their changes.
95+
96+
See (Chart advanced tuning)[/appstore/widgets/chart-advanced-tuning/] for more information on fine tuning **Custom Chart** with using **Chart Playground** widget.
97+
98+
{{% alert color="info" %}}
99+
Since the introduction of design mode, react-ready widgets can render data as it is entered. This makes it possible for user to see Static data and configurations directly in design mode without the needs of running the apps.
100+
{{% /alert %}}
101+
102+
## Dimension
103+
104+
These are the dimension configurations for custom charts:
105+
106+
- **Width** — Determines the width size for the custom charts. User can choose to use either pixels (px) or percentage (%).
107+
- **Height** — Determine the height size for the custom charts. User can choose to use either pixels (px), percentage (%), or Viewport (vh). Choosing setting to **Auto** will allow user to set minimum and maximum height instead.
108+
- **Minimum Height** — Determines the minimum size for the custom charts container.
109+
- **Maximum Height** — Determines the maximum size for the custom charts container.
110+
- **Vertical Overflow** — If maximum height is set, vertical overflow will determine the widget's behavior to show overflowing content if it reached height size larger than the maximum height allowed.
111+
112+
113+
## Events
114+
115+
- **On Click** — Determines the actions that will be triggered if parts of the custom charts is clicked.
116+
- **Event data attribute** — The string value that the chart uses when click events occur. User can use this same attribute as the parameters for on-click events action to retrieve the data from the custom chart:
117+
118+
{{< figure src="/attachments/appstore/platform-supported-content/widgets/charts/charts-tutorials/charts-any-usage/custom-chart-events-attribute.png" alt="Setup on click events" class="no-border" >}}
119+
120+
## Read More
121+
122+
* **Any Chart** properties: [Any Chart](/refguide/charts-any-configuration/)
123+
* The most common chart types: [Any Chart Cheat Sheet](/refguide/charts-any-cheat-sheet/)
124+
* The most common settings: [Configuration Cheat Sheet](/refguide/charts-advanced-cheat-sheet/)
125+
* The full JSON reference: [https://plot.ly/javascript/reference/](https://plot.ly/javascript/reference/)
126+
* [JSON Structures](/refguide/json-structures/)
127+
* [Export Mappings](/refguide/export-mappings/)

content/en/docs/appstore/use-content/platform-supported-content/widgets/charts/charts-dynamic-series.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ To view the chart, follow these steps:
102102
## Read More
103103

104104
* [Create a Basic Chart](/appstore/widgets/charts-basic-create/)
105-
* [Fine-Tune a Chart with Advance Settings](/appstore/widgets/chart-advanced-tuning/)
105+
* [Fine-Tune a Chart with Chart Playground](/appstore/widgets/chart-advanced-tuning/)
106106
* [Use Any Chart](/appstore/widgets/charts-any-usage/)

content/en/docs/appstore/use-content/platform-supported-content/widgets/security/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ The following widgets are not fully compliant with strict CSP. See the widgets'
1919

2020
### Charts
2121

22-
You can enable `allowlist` CSP for [Charts](/appstore/widgets/charts/) by including these directives:
22+
Use [Charts](/appstore/widgets/charts/) version 6.0 and above for strict CSP compliance.
23+
24+
For older versions, you can enable `allowlist` CSP for [Charts](/appstore/widgets/charts/) by including these directives:
2325

2426
```text
2527
style-src 'self' 'unsafe-inline';
Loading
Loading
Loading

0 commit comments

Comments
 (0)