> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/understand-account-industries.md).

# Understand Account Industries

Build a Word Cloud from Account industries, size each label by record count, and check missing labels before interpreting your customer mix.

An account manager wants to see which industries dominate a customer list. Build an Avonni Word Cloud that displays each distinct Industry value as one label, sized by the number of accounts, then check that the visible labels represent the selected records.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FA6L2cRgLTgrrZBzSIXIZ%2Fchart-word-cloud-result-compact.jpg?alt=media" alt="Account industry Word Cloud preview with Manufacturing largest and Retail smallest"><figcaption><p>Builder preview using the same 20 sample Accounts. Manufacturing has 8 records and Retail has 1; labels are horizontal.</p></figcaption></figure>

[View this capture at full size](https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FA6L2cRgLTgrrZBzSIXIZ%2Fchart-word-cloud-result-compact.jpg?alt=media)

## Before You Start

* Open a Dynamic Component you can edit, or follow [Creating a new component](https://docs.avonnicomponents.com/dynamic-components/avonni-components-app/creating-a-new-component.md).
* You need access to Account records and their record ID and Industry fields. Use a small account set whose industry counts you can check.
* See the [Chart reference](https://docs.avonnicomponents.com/dynamic-components/components/chart.md) for Word Cloud properties and [Query](https://docs.avonnicomponents.com/dynamic-components/component-builder/data-sources/query.md) for filters.
* You can use the same sample accounts as [Map Account Coverage by Province](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/map-account-coverage-by-province.md), but completing that tutorial is not required.

## Steps

{% stepper %}
{% step %}

### Count the Industries in Your Account Set

Choose the account list you want to understand. Count its records by Industry before configuring the chart.

The example uses 20 sample Accounts with names starting with `Chart Docs -` :

| Industry        | Expected accounts |
| --------------- | ----------------- |
| Manufacturing   | 8                 |
| Food & Beverage | 4                 |
| Technology      | 3                 |
| Transportation  | 2                 |
| Consulting      | 2                 |
| Retail          | 1                 |
| Total           | 20                |

These counts measure customer mix by number of accounts. They do not measure revenue or the size of an individual customer.
{% endstep %}

{% step %}

### Add Word Cloud and Connect the Accounts

Add **Chart** from the **Component Library** and select it on the canvas. In **Edit Chart > Properties > Content**, set **Type** to **Word Cloud** and **Title** to `Accounts by industry`.

In **Data Source**, select **Query**. In **Records**, choose or create an Account query. Use **Edit the query** to restrict it to your chosen customer set.

For the sample, filter Name (`Name`) to values starting with `Chart Docs -` . Use the same filter in your independent industry count. For your own data, replace the sample-name rule with the conditions defining your customer set.
{% endstep %}

{% step %}

### Map the Whole Industry Label

Open **Data Mappings > Words** and click **Add Words**. Set **Field** to Industry (`Industry`) and save the entry.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FFHjyCIbc4KwL3pH4ANSh%2Fchart-words-field.jpg?alt=media" alt="Words entry with Field Industry beside Words and Word Size mappings" width="480"><figcaption><p>Words supplies the labels. Each distinct Industry value becomes one label.</p></figcaption></figure>

[View this capture at full size](https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FFHjyCIbc4KwL3pH4ANSh%2Fchart-words-field.jpg?alt=media)

Each distinct field value becomes a label. `Food & Beverage` stays one label. The chart does not split that value into separate words.

Use one **Words** entry for this guide. Multiple entries combine values from several fields; that answers a different question from counting accounts by Industry alone.
{% endstep %}

{% step %}

### Size Each Label by Account Count

Open **Data Mappings > Word Size**. Set **Field** to the Account record ID (`Id`) and **Measures** to **Count**, then save the entry.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FLDocqBJhEdpuwvqNpREi%2Fchart-word-size.jpg?alt=media" alt="Word Size entry with Field Id and Measures Count" width="480"><figcaption><p>Word Size supplies the calculation. Count on Id sizes each industry by its number of Account records.</p></figcaption></figure>

[View this capture at full size](https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FLDocqBJhEdpuwvqNpREi%2Fchart-word-size.jpg?alt=media)

**Words** supplies the labels. **Word Size** supplies their measure. Counting a populated record ID gives each industry its number of accounts.
{% endstep %}

{% step %}

### Fit the Labels and Check the Ranking

In **Words Configuration**, set **Word Orientation** to **Horizontal** and turn on **Fit All Words**. In **Style > Size**, set **Height** to `280 px` for this example.

Click **Preview**. Compare the visible labels with the source counts. In the sample, Manufacturing has eight accounts and is the largest label. Retail has one and is the smallest. Confirm that the full `Food & Beverage` label is visible and that all six industry labels appear.

Do not estimate an exact count from a label's apparent size. Use your independent account counts to confirm the ranking.

If a label is missing, check its source value and measure before changing the layout. Blank labels, the value `-`, and labels whose measured value is zero or negative are excluded before placement. For this **Count** on `Id` example, check blank Industry values first.

**Fit All Words** attempts to fit the eligible labels. If space is still too limited, labels can be omitted. Increase the chart height before relying on a partial cloud as a complete view of your account mix.
{% endstep %}

{% step %}

### Save and Test

Click **Save** once the label list and ranking match your source check. The screenshots show the Builder preview with sample accounts.

When you are ready to share your own component, follow [Publishing your Dynamic Components](https://docs.avonnicomponents.com/dynamic-components/core-concepts/publishing-your-dynamic-components.md) to activate the version and place it on a Lightning Page.

Check the same customer set as a person who will view the page. Queries use that person's Salesforce access, which can change the account counts and the resulting cloud.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>Industry names are missing</summary>

Check whether the query includes the relevant accounts and whether Industry contains a value. Blank values and `-` are excluded. Check **Word Size** uses **Count** on `Id`, then check the chart has enough height for the eligible labels.

</details>

<details>

<summary>Food &#x26; Beverage is missing or hard to read</summary>

Check that the complete field value exists in the query results. Keep **Word Orientation** at **Horizontal**, turn on **Fit All Words**, and increase **Style > Size > Height** if the label still cannot fit. Automatic fitting does not guarantee that every label can be placed.

</details>

<details>

<summary>The largest label does not match the most common industry</summary>

Check **Word Size > Field** is `Id` and **Measures** is **Count**. Another numeric field or measure answers a different question. Recheck the query scope and your independent counts.

</details>

<details>

<summary>Labels from another Account field appear</summary>

Check **Data Mappings > Words**. Keep only the Industry entry for this example. Several word fields contribute their distinct values to the cloud; the entries do not stay separate categories.

</details>

## Related Tutorials

* [Map Account Coverage by Province](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/map-account-coverage-by-province.md): map the same account set and reconcile region matches.
* [Track Won Revenue by Month](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/track-won-revenue-by-month.md): follow a revenue measure across distinct calendar months.
* [All Chart tutorials](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart.md): choose another question to answer with Chart.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/understand-account-industries.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
