> 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/map-account-coverage-by-province.md).

# Map Account Coverage by Province

Build a Canada map from Account records, count accounts by province, and check full province names so missing matches do not hide coverage.

A territory manager needs to see where customer accounts are concentrated and where coverage is thin. Build an Avonni Choropleth Map of Canada using Account Billing State/Province, then reconcile the mapped total with the source records so unmatched names do not hide part of the customer base.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FmJJrHO1utc7WTKbPRmQs%2Fchart-map-result.jpg?alt=media" alt="Canada map preview shaded by Account count, with a total of 20 sample Accounts"><figcaption><p>Builder preview using 20 sample Accounts. Ontario has 8 accounts and Québec has 4. Your totals depend on your records and filters.</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%2FmJJrHO1utc7WTKbPRmQs%2Fchart-map-result.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 Billing State/Province fields.
* Choose a Canadian account set with full province names. Use a sandbox if you need to prepare sample records or correct test values.
* See the [Chart reference](https://docs.avonnicomponents.com/dynamic-components/components/chart.md) for map options and [Query](https://docs.avonnicomponents.com/dynamic-components/component-builder/data-sources/query.md) for filters. This guide counts accounts; the map does not assign territories or change Salesforce sharing.

## Steps

{% stepper %}
{% step %}

### Establish the Source Count

Choose the accounts that belong in your coverage view. Check their Billing State/Province values and count the records by province before building the map.

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

| Billing State/Province | Expected accounts |
| ---------------------- | ----------------- |
| Ontario                | 8                 |
| Québec                 | 4                 |
| British Columbia       | 3                 |
| Alberta                | 2                 |
| Manitoba               | 2                 |
| Nova Scotia            | 1                 |
| Total                  | 20                |

For your own data, record your own totals. Keep the same filters when you compare the chart with a Salesforce report or record list.
{% endstep %}

{% step %}

### Add the Chart and Select the Account Set

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

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

For the sample, filter Name (`Name`) to values starting with `Chart Docs -` . All 20 sample accounts are Canadian. For your own coverage view, replace this sample-name rule with the conditions defining your Canadian customer set.

In **Style > Size**, set **Height** to `320 px` for a map like this example.
{% endstep %}

{% step %}

### Choose Canada and Province Boundaries

Return to **Properties** and open **Map**:

| Setting         | Value                  |
| --------------- | ---------------------- |
| Type            | Country                |
| Regions         | Add one item: `Canada` |
| Map Separations | State/Province         |

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Fr5uhbeeWkM38MLCDKy9I%2Fchart-map-settings.jpg?alt=media" alt="Map settings with Type Country, Regions Canada and Map Separations State/Province" width="320"><figcaption><p>Map chooses the geography to draw. Regions contains the country name, Canada.</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%2Fr5uhbeeWkM38MLCDKy9I%2Fchart-map-settings.jpg?alt=media)

These settings choose the geography to draw. They do not yet tell the chart which Account field identifies a province.
{% endstep %}

{% step %}

### Match Account Values to the Provinces

Open **Data Mappings > Region** and add its single entry if it is empty. Open the row and set:

| Region entry setting | Value                                   |
| -------------------- | --------------------------------------- |
| Type                 | Region                                  |
| Region               | Billing State/Province (`BillingState`) |

Click **Save** in the entry popup.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FocsJMnWg2kFvRS6ncV7Y%2Fchart-map-region.jpg?alt=media" alt="Region mapping popup with Type Region and Billing State/Province selected" width="480"><figcaption><p>Region mapping matches records to the map. Its Type is Region; Map > Type remains Country.</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%2FocsJMnWg2kFvRS6ncV7Y%2Fchart-map-region.jpg?alt=media)

The Region entry's **Type** is **Region**. The **Map** group's **Type** remains **Country**. They control different parts of the setup.

Names must match the map's province names, ignoring capitalization. `ON` does not match `Ontario`. Accents still matter: the Canada map uses `Québec`.
{% endstep %}

{% step %}

### Count the Accounts and Reconcile the Map

In **Data Mappings > Value**, set **Field** to the Account record ID (`Id`) and **Measures** to **Count**. Save the entry. In **Chart**, turn on **Show Total**.

Click **Preview** and compare the total and province values with your source check. For the sample, all 20 accounts match, including eight in Ontario and four in Québec.

If the query returns 20 records but the mapped total is lower, inspect the records in the missing province. Check the mapped field and its exact names before treating an empty region as a gap in customer coverage.

Count on `Id` measures accounts, rather than sales value or population. A province with more accounts is not necessarily the province with the most revenue.
{% endstep %}

{% step %}

### Save and Test

Click **Save** after the source and mapped totals agree. The screenshots show the Builder preview with sample records.

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.

Repeat the source-count check with a person who will view that page. Their Salesforce access can give them a different account set from yours.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>The chart shows no Canada map</summary>

Check **Map > Type** is **Country**, **Regions** contains `Canada`, and **Map Separations** is **State/Province**. A region name that does not match can produce a message instead of a map.

</details>

<details>

<summary>A province is empty even though you have accounts there</summary>

Check **Data Mappings > Region** uses **Type** = **Region** and the `BillingState` field. Compare the records with the full map names, including accents. Then confirm that the query actually includes those accounts.

</details>

<details>

<summary>The total is lower than the source count</summary>

Separate the two checks: first count the query's Account records, then check how their region values match the map. A blank value, abbreviation or different spelling can leave a record unmatched. Do not change a source value solely to make the chart look complete without checking that it describes the correct province.

</details>

<details>

<summary>The chart asks for coordinates</summary>

The Region entry's **Type** is set to **Geo Location**. This guide uses province names, so set it to **Region**. Coordinates are a separate mapping option described in the [Chart reference](https://docs.avonnicomponents.com/dynamic-components/components/chart.md).

</details>

## Related Tutorials

* [Understand Account Industries](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/understand-account-industries.md): examine the same account set by industry instead of location.
* [Compare Total and Average Deal Size](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/compare-total-and-average-deal-size.md): compare value and average size across opportunity stages.
* [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/map-account-coverage-by-province.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.
