Add and join data
The first step to visualizing and charting data is adding it to Map Viewer. You'll download two .csv files with intimate partner violence (IPV) and shelter capacity data, add them to a map as tables, and examine their attributes.
Open the map
First, you'll open a map of Canada in ArcGIS Online. Then you'll sign in and save a copy of the map.
- Open the Canadian Provinces and Territories map.
A basemap of Canada appears.

This basemap uses the Canada Lambert Conformal Conic map projection instead of the more common Web Mercator projection. Web Mercator greatly distorts area, which is particularly problematic for the northern regions of Canada. For more information, see this coordinate system definition from Statistics Canada. For more information on choosing a basemap, see this help topic.
- On the ribbon, click Sign In. Sign in using your ArcGIS organizational account.
Note:
If you don't have an organizational account, see options for software access.
- On the Contents (dark) toolbar, click Save and open and choose Save as.

The theme of the map will be intimate partner violence and domestic violence shelter capacity in Canada, so you'll name the map accordingly.
- For Title, replace the current text with: Intimate partner violence and domestic violence shelter capacity in Canada.
- For Tags, replace the current tags with domestic violence shelters and intimate partner violence.
- For Summary, replace the text with Map showing the rate of police-reported intimate partner violence and domestic violence capacity by Canadian province or territory.

- Click Save.
Add CSV files
Next, you'll download a .zip file that contains two .csv files with information about domestic partner violence in Canada. Once you download the data, you'll add the files to the map as tables.
- Download the IPVData.zip file. Extract the folder to a location you can easily remember, such as your Documents folder.
The file contains two .csv files that store data about police reported IPV and domestic violence shelter capacity in Canada.
- On the Contents toolbar, click the Add button and choose Add layer from file.

- In the Add Layer window, click Your device.
- Browse to and open the extracted IPVData folder. Double-click Police_reported_intimate_partner_violence_province_territory.csv.
- In the Add Layer window, for How would you like to add this file?, confirm that Create a hosted feature layer and add it to the map is selected.

- Click Next.
The 11 fields in the .csv file populate in the Add Layer window. The field names match the column headers in the .csv file.

You can choose which fields are imported by unchecking the box next to its name. For this workflow, you'll keep all the fields.
- Click Next.
On the next page, you can define locations for the data using addresses or place names. The file does not contain location data, so you'll confirm there are no location settings.
- For Location settings, confirm that None is selected.

- Click Next.
- For Title, type Police reported intimate partner violence, followed by your name or initials.
Note:
You cannot create two layers in an ArcGIS organization with the same name. Adding your initials to a layer name ensures that other people in your organization can also complete this tutorial. Once a layer has been created, you can rename it in the map to remove your initials, which will not affect the name of the underlying data layer.
- For Summary, type Police-reported intimate partner violence by Canadian province/territory, 2019.
- Click Create and add to map.
- On the Contents toolbar, click Tables.
The Police reported intimate partner violence table is listed in the Tables pane.

- Add the Domestic_violence_shelter capacity_province_territory.csv file to the map with the following properties:
- For How would you like to add this file?, confirm Create a hosted feature layer and add it to the map is selected.
- For Fields, confirm 14 fields are populated.
- For Location settings, confirm None is selected.
- For Title, type Domestic violence shelter capacity followed by your name or initials.
- For Summary, type Domestic violence shelter capacity by Canadian province/territory, 2021.
After you add the Domestic violence shelter capacity table, it is listed in the Tables pane.

The tables also open in the Table view. You'll review each table's attributes and ensure that the data was imported correctly.
- In the Table view, click the Police reported intimate partner violence tab.
The table has 11 fields (columns) and 14 records (rows).
- Click the Domestic violence shelter capacity tab.
The table has 14 fields (columns) and 14 records (rows).
- Close the Table view.
Join a table to a boundaries layer
Next, you'll use the Join Features analysis tool to join the data to a Canadian provinces and territories boundaries layer in ArcGIS Online. By joining the data, you'll be able to visualize it on the map.
You'll start by joining the Police reported intimate partner violence table to a feature layer of Canadian province and territory boundaries from ArcGIS Online. The result will be a feature layer with the same shapes as the boundaries feature layer and the same attributes as both the boundaries feature layer and the Police-reported intimate partner violence table.
- On the Settings (light) toolbar, click the Analysis button.

Note:
If you do not see the Analysis button, contact your ArcGIS administrator. You may not have the privileges required to perform analysis.
- In the Analysis pane, click Tools.

- Under Summarize data, click Join Features.

- For Target layer, click Layer.

The target layer is the layer that will receive the joined fields. You'll browse to the Provinces and Territories of Canada feature layer in ArcGIS Online.
- In the Select layer window, click Browse layers.

- In the Select layer window, click My content and choose ArcGIS Online.

- In the search box, type provinces and territories of Canada.

- For the Provinces and Territories of Canada search result owned by Esri Canada Content, click Select layer and choose Canana_Provincal_boundaries_generalized.

The Provinces and Territories of Canada layer is selected for use in the Join Features tool.
- Click Confirm to add the layer as the target features of the join operation.
The Target layer parameter is populated with the layer from ArcGIS Online.

Next, you'll choose the join layer, which will be one of the CSV files you added to the map.
- In the Join Features tool, for Join layer, click the Layer button and choose Police reported intimate partner violence.

Next, you'll set the fields in the target and join layers that you'll use to make the join. To join two layers or tables, there needs to be a matching field in each layer. Otherwise, the tool won't know which feature to join to which. You'll choose fields that contain the abbreviated name of each province or territory.
- For Join settings, set the following parameters:
- Confirm that Use attribute relationship is enabled.
- For Target field, choose Abbreviation / Abréviation.
- For Join field, choose Prov_terr_code.

Next, you'll specify how the layers are joined. You'll use the default settings, which will join the first matching record for each layer. These settings are fine because each layer only has one feature per province or territory, so there won't be multiple matching records.
You'll also set the join type to Left join. This setting ensures all target features are returned, even if the target feature does not have a match in the join layer. This option will make it easier to find out whether any provinces or territories do not have records.
- Set the following parameters:
- For Join operation, confirm that Join one to one is selected.
- For Multiple matching records, confirm that Only keep first matching record is selected.
- For Join type, choose Left join.

- For Output name, type Intimate partner violence, followed by your name or initials.
- Click Estimate credits.
The join operation will use 0.027 credits.
- Click Run.
- At the top of the Join Features pane, click the History tab.

The tool's status is shown. When the tool completes, the output layer appears on the map.

Join another table to the output layer
Next, you'll join the Domestic violence shelter capacity table to the output layer you just created. The result will be a new feature layer with the features and attributes of the previous join layer, plus the attributes of the Domestic violence shelter capacity table.
- In the History pane, next to Join Features, click the Options button and choose Open tool.

The Join Features tool reappears. The parameters are already set with the choices you made earlier. You'll modify some of the parameters to join the Domestic violence shelter capacity table to the Intimate partner violence layer.
- For the Join features tool, change the following parameters:
- For Target layer, choose Intimate partner violence. (If necessary, in the Select layer window, click Browse layers and choose it from the list of layers in My content.)
- For Join layer, choose Domestic violence shelter capacity.
- For Output name, type Intimate partner violence and shelter capacity, followed by your name or initials.
- Leave the other parameters unchanged and click Run.
When the tool completes, the output layer appears on the map.
- On the Contents toolbar, click Layers.

The two layers you created are listed in the Layers pane. You no longer need the Intimate partner violence layer, so you'll remove it.
- In the Layers pane, for the Intimate partner violence layer, click the Options button and choose Remove.

The layer is removed.
- On the map, click any Canadian province or territory.
A pop-up appears, listing the fields for the province or territory you clicked.

The pop-up includes all the attributes from the two tables and the ArcGIS Online layer that were joined together.
- Close the pop-up. Save the map.
You have joined attributes from several layers and have created two layers that contain all the attributes from the input tables. You can use these additional attributes in pop-ups, for symbology, and for charting.
Style the layer and configure a pop-up
Next, you'll style the data to show the rate of intimate partner violence and the number of domestic violence shelter beds in each province or territory. Then, you'll configure the layer's pop-up to convey the most important information.
Style the data
You'll use smart mapping to create a bivariate map, which is a kind of map that displays two different variables at the same time. You'll visualize the number of domestic violence shelter beds and the rate of intimate partner violence by province or territory.
- If necessary, in the Layers pane, click the Intimate partner violence and shelter capacity layer to select it.
When a layer is selected, a blue line appears next to its name.

- On the Settings toolbar, click the Styles button.

- In the Styles pane, for Choose attributes, click Field.

You'll add two fields. One will show the total number of domestic violence shelter beds and the other will show the rate of intimate partner violence per 100,000 adults (aged 15 to 89).
- In the search box, type total. Select the Total_rate and Total beds fields and click Add.

A default style, Color and Size, is applied to the layer.

The size of the symbols correspond to the number of beds, with larger symbols having more beds, while the symbol's color corresponds to the rate of violence, with darker symbols having higher rates.
With the default color scheme, provinces or territories with lower rates of violence don't show up well on the gray basemap. Also, a blue color ramp isn't thematically appropriate for a subject like violence. You'll change the color scheme. You'll also change the shape of the symbols from circles to diamonds to give your map a more unique appearance.
- For Pick a style, for Color and Size, click Style options.

You have the option to change the style for the symbols colors or sizes. You'll change the colors.
- For Counts and Amounts (color), click Style options.
- In the Style options pane, under Symbol style, click the color ramp.

- In the Style options pane, for Current symbol, click Basic point.

- Click the diamond symbol.

- In the Symbol style window, click Done. For Colors, click the color ramp.

A list of other color ramps appears.
- In the Ramp window, under Category, choose Purples and pinks. Click the Andromeda color ramp.
Tip:
To see the name of a color ramp, point to it.

By default, this color ramps styles lower rates with a darker color. It makes more sense for higher rates to have a darker color, so you'll flip the ramp colors.
- Click Flip ramp colors.

Now, higher rates have darker colors. To improve visibility, you'll also add a darker outline to the symbol.
- In the Ramp window, click Done. In the Symbol style window, for Outline color, click the color ramp.

- In the Select color window, change the color hex code (#) to 555555.

- In the Select color window, click Done.
- In the Symbol style window, change Outline transparency to 50 percent.

Lastly, you'll remove the background symbol. This symbol represents the province and territory polygon boundaries. Currently, the symbol only has an outline. Because some province and territory boundaries have a lot of detail (especially near coasts), this outline symbol appears overly dense at some locations.
- Close the Symbol style window. In the Style options pane, turn off Show background symbol.

- In the Style options pane, click Done.
The map is updated to use the new color ramp and outline color.

On the map, the Canadian territories (the three northernmost symbols) are shaded the darkest colors, while the provinces are represented by lighter shades. The rates of intimate partner violence are higher in the territories than in the rest of the country, with the highest rates in Northwest Territories and Nunavut.
In addition to rates of intimate partner violence, the map also shows the number of domestic violence shelter beds, with larger symbols representing higher numbers of beds. Ontario and Quebec have the highest number of shelter beds in Canada, possibly due to the higher populations of these provinces.
- In the Style options pane, click Done. Click Done again.
Add an effect
To make the symbols stand out more, you'll add a drop shadow effect to them.
- On the Settings toolbar, click the Effects button.

- In the Effects pane, turn on Drop shadow.

You have options to change the color, width, and opacity of the drop shadow, but the default settings are fine in this case.
- Close the Drop shadow pane and the Effects pane.
The drop shadow has been applied. The symbols now stand out more against the basemap.

Configure the pop-up
When you looked at the layer's pop-up, it had a long list of fields with a lot of unneeded information. You'll replace the field list with text and a chart.
- On the Settings toolbar, click the Pop-ups button.

First, you'll change the pop-up's title to only show the name of the province or territory.
- In the Pop-ups pane, click Title.
- In the Title box, delete all of the existing text except {Name_EN}.

Fields are surrounded by curly braces. The province or territory name field is {Name_EN}. Next, you'll remove the fields list from the pop-up.
- For Fields list, click the Options button and choose Delete.

- Click Add content and choose Text.

- In the text box, type (or copy and paste) the following text: The rate of police-reported intimate partner violence (IPV) in {Name_EN} in 2019 was
- Press the space bar and type {. Type Tot.
A list of fields appears. You'll insert the Total_rate attribute field.
- Click the Total_rate field.

The field is added to the text.
- After the {Total_rate} field, type per 100,000 adults (aged 15 – 89).
- Highlight all of the text and click the Italic button.
- Highlight {Total_rate} per 100,00 adults (aged 15 – 18) and click the Bold button.

- Click OK.
- If necessary, on the map, click a province to see the pop-up.

Add a chart
Next, you'll add a chart to the pop-up. A chart is a graphical representation of data that comes in many types, such as bar charts, scatter plots, pie charts, and line charts. Pie charts group data into slices to visualize part-to-whole relationships. You'll configure a pie chart for the pop-up to visualize intimate partner violence reports by gender.
- In the Pop-ups pane, click Add content and choose Chart.
- In the Configure chart window, choose Pie.

- Click Select fields.

- In the Select fields box, search for number. Select Female_number and Male_number.

- Click Done.
The pie chart shows the proportion of intimate partner violence reports by women and men in orange and blue.
- In the Configure chart window, click Done.
- In the Pop-ups pane, under Media, for Description, type (or copy and paste) the following text: The following chart shows the number of intimate partner violence reports by gender.
You'll finish the pop-up by adding a sentence about domestic violence shelter beds.
- In the Pop-ups pane, click Add content and choose Text.
- In the text box, type (or copy and paste) the following text: In 2021, there were {Total_number} beds in domestic violence shelters in {Name_EN}, out of a total of 9,197 beds in all of Canada.
- Highlight {Total_number} beds and click the Bold button. Click OK.
The pop-up now contains the chart showing the number of intimate partner violence reports by gender and a meaningful description.

- Close the Pop-ups pane and any open pop-ups. Save the map.
You have modified the layer style to better represent the data. You have also configured the pop-up to include only the information that you want and display a chart. Now, when a user views a pop-up on this layer, the pop-up is much more succinct.
Create charts
Next, you'll configure a series of charts that examine the data in more detail. When used in conjunction with maps, charts can help you tell a more complete story with data. You'll create three bar charts that uncover spatial patterns and relationships in the data.
Create a chart showing reports
First, you'll create a bar chart showing the number of police-reported intimate partner violence (IPV) incidents by province or territory.
- On the Settings toolbar, click Configure charts.

- In the Charts pane, click Add chart and choose Bar chart.

- In the Data pane, for Category, choose Province_territory.

- For Numeric fields, click Select numeric fields.
- Choose Total_number and click Done.
The bar chart shows the total number of reports by province or territory.

The chart looks good, but you can apply the same colors as the layer by changing its aggregation type.
- On the Data tab, for Aggregation, choose No aggregation

The colors in the chart now match the layer's symbology.

- On the chart, point to some of the bars, including the highest and lowest bar.

Ontario has the highest number of reports at 30,185, while Prince Edward Island has the lowest number at 354. Given the difference in population for these two provinces, it might be more meaningful to look at the rate of IPV for every 100,000 adults, rather than the number of reports.
- For Numeric fields, remove Total_number.

- Click Select numeric fields. Choose Total_rate and click Done.
- For Aggregation, choose No aggregation.
- For Sort order, choose Y-axis descending.

The chart is organized so provinces or territories with higher rates appear first.

The rate of IPV for every 100,000 adults is highest in Nunavut, while Ontario and Prince Edward Island have the two lowest rates. These are the same results you saw after applying smart mapping styles to the map.
To finish the chart, you'll update its title and axis titles.
- In the Data pane, click the General tab.

- Update the following parameters:
- For Chart title, type Rate of police reported IPV by province or territory.
- For X-axis title, type Province or territory.
- For Y-axis title, type Rate of IPV per 100,000 adults.
The chart updates to reflect your changes.

Create a chart showing rates by gender
Next, you'll create another bar chart comparing the rates of male and female IPV reports by province or territory.
- In the General pane, click the Back button.

- Click Add chart and choose Bar chart.
- In the Data pane, for Category, choose Province_territory.
- Click Select numeric fields. Select Female_rate and Male_rate.

- Click Done.
The bar chart shows female and male IPV rates in different shades of blue.

You'll change the colors to better differentiate between the male and female rates. You'll also provide clearer labels for the chart legend.
- Click the Series tab.

- Under Series, click Female_rate.
- In the Series style window, change Label to
Female IPV rate. Change the hex value (#) to 914a87.

- On the Series tab, under Series, click Male_rate.
- In the Series style window, change Label to Male IPV rate. Change the hex value (#) to f59d7d.
- Close the Series style window.
- In the Series pane, click the General tab. Enter the following parameters:
- For Chart title, type Male and female IPV rates by province or territory.
- For X-axis title, type Province or territory.
- For Y-axis title, type Rate of IPV per 100,000 adults.
The chart updates.

According to the chart, the rate of IPV reports by women is higher than the rate of IPV reports by men in all provinces and territories, with the largest discrepancy between the genders occurring in Northwest Territories and Nunavut.
Create a chart showing percentage change
Next, you'll compare the percentage change of IPV rates from 2018 to 2019 for both genders by province and territory.
- In the General pane, click the Back button.
- Click Add chart and choose Bar chart.
- On the Data tab, for Category, choose Province_territory.
- Click Select numeric fields. Select Female_percent_change_2018_2019 and Male_ percent_change_2018_2019 and click Done.
You'll change the colors to match the ones you used for the previous chart. You'll also provide clearer labels for the chart legend.
- Click the Series tab. Under Series, click Female_percent_change_2018_2019.
- In the Series style window, change Label to Female IPV percentage change (2018 to 2019). Change the hex value (#) to 914a87.
- On the Series tab, under Series, click Male_ percent_change_2018_2019.
- In the Series style window, change Label to Male IPV percentage change (2018 to 2019). Change the hex value (#) to f59d7d.
- Close the Series style window. Click the General tab and enter the following parameters:
- For Chart title, type Male and female IPV percentage change (2018 to 2019) by province or territory.
- For X-axis title, type Province or territory.
- For Y-axis title, type IPV percentage change.
The chart is complete.

Although the previous chart showed that the rate of IPV reports by women is consistently higher than the rate of IPV reports by men across the country, this chart shows that in many provinces and territories, men's IPV reports increased at a higher rate than women's IPV reports between 2018 and 2019. It's also worth noting that in Prince Edward Island, rates of IPV reporting for both genders decreased from 2018 to 2019. You can explore the data further to find possible explanations for these trends.
- Close the chart.
The Charts pane appears. The three charts you configured are listed.

Interact with the charts
The data in the charts is connected to the data in the map, so you can interact with a chart to make selections on the map.
- In the Charts pane, click the Male and female IPV rates by province or territory chart.
The chart is displayed over the map.
- At the top of the chart, click the Collapse button.

The chart collapses, allowing you to better see the map.
- On the chart, click the highest purple bar.
The corresponding territory, Nunavut, is selected on the map.

- On the map, click Nunavut to view its pop-up.

The colors in the pop-up's pie chart don't match the other charts that you created. You'll change pie chart colors to match the bar chart colors.
- On the Settings toolbar, click Pop-ups.
- In the Pop-ups pane, click Media.

- For Media content, click No title.

- Click the symbol for Female_number.

- Change the hex value (#) to 914a87 and click Done.
- Click the symbol for the Male_number field. Change its hex value (#) to f59d7d and click Done.
Now the pie chart colors in the pop-up match the colors in the bar chart.

- In the Configure chart window, click Done. Close the pop-up.
- On the chart, click the Expand button.
- Click the Clear selection button.

Nunavut is deselected on the map. You can edit a chart at any time by clicking it in the Charts list and clicking the Edit chart button in the chart display.
- Close the chart. Save the map.
You have created three bar charts to explore the IPV data in more detail. The charts provided some additional insights into IPV patterns and trends in Canada.
Share an app
Now that you've created the map and charts, you'll create and configure an app using ArcGIS Instant Apps to share the visualizations with members of your organization. You'll use the Chart Viewer app template, which allows users to explore the map alongside the charts you created.
Share the map
Before you can create the app, you must share the map with your organization. When you share the map, the charts are shared with it.
- On the Contents toolbar, click the Share map button and choose Manage sharing.

The Share window appears. You'll share the map with other members of your organization.
- In the Share window, select Organization.

- Click Save.
To share the map, you must also share the layers in the map.
- In the Item sharing successfully updated window, click Review sharing.
- In the Review sharing window, click Update sharing.

The map and layers are shared with your organization. You can now create the web app.
Create an app
Next, you'll create the web app.
- On the Contents toolbar, click Create app and choose Instant Apps.

The Instant Apps page appears in a new browser tab.
- For the Chart Viewer template, click Choose.

- In the Create app - Chart Viewer window, for Give your app a title, type Intimate partner violence and domestic violence shelters in Canada.
- Click Create app.
The Configure Chart Viewer page appears in a new browser tab. The app is created based on the template you chose and currently shows one chart. The app configuration window provides several app settings and an interactive preview of the app.
- Next to the chart, select all three chart icons to display them.

The charts are selected and the charts appear in the app.

- In the Express pane, click Step 3. About.

The About pane appears.
- In the About pane, turn on the Introduction window toggle button.

- For Introduction window title, type Intimate partner violence and domestic violence shelter capacity in Canada.
- For Introduction window content, click the Edit button. Type (or copy and paste) the following text:
Intimate partner violence (IPV), also known as spousal or domestic violence, is a form of gender-based violence that includes physical, sexual, emotional, and financial abuse, and other types of violence and control. Mapping police-reported incident data shows where rates of IPV are highest across Canadian provinces and territories, as well as other patterns and relationships. Domestic violence shelters are one type of service available for survivors of IPV and shelter capacity varies across regions.
Explore and interact with the charts and map to get a deeper understanding of intimate partner violence and domestic violence shelter data in Canada.
The data used to create the map and charts is adapted from Statistics Canada, Canadian Centre for Justice and Community Safety Statistics, Incident-based Uniform Crime Reporting Survey, Trend Database, and National Service Provider List, 2021.
- In the last paragraph, highlight the text Canadian Centre for Justice and Community Safety Statistics. On the toolbar, click the Link button.

- For Link URL, copy and paste the following link:
https://www150.statcan.gc.ca/n1/pub/85-002-x/2021001/article/00001-eng.htm
- Click the Save button.

- In the last sentence, highlight the text National Service Provider List and give it a link to the following URL:
https://open.canada.ca/data/en/dataset/7e0189e3-8595-4e62-a4e9-4fed6f265e10/resource/dd8d935c-3e40-42d1-8de3-2e18f3877000?inner_span=True
- In the Introduction window content window, click Close.
The introduction window text updates.

- Close the introduction window.
Change the theme
Next, you'll change the app's theme. Then, you'll publish the app.
- In the About pane, click Back.
- Click Step 5. Theme & Layout.
- For Select a preset theme, choose Street.

The app is ready to publish.
- Click Publish.

- In the Publish window, click Confirm.
The Share window appears, which includes a link to the app and a button to launch it in a new window to test.
- In the Share window, click Change share settings. Choose Organization and click Save.
The app is shared with members of your organization.
- Click Exit.

- In the Exit application configuration window, click Exit.
The item page for the app appears.
- Click View.

The app opens in a new browser tab. The introduction panel you configured appears.
- Click Explore. Explore your app.
Note:
The app only has one chart open by default. You can click the chart icons, as you did previously, to view the other charts you created.
You have shared the map with your organization and configured an app to display the map and charts together to visualize and interact with the data. This app will help other organization members better understand spatial patterns of intimate partner violence and domestic violence shelter capacity across Canada.
In this tutorial, you worked with intimate partner violence and domestic violence shelter data in .csv files from Statistics Canada. You began by adding the data as tables to Map Viewer, exploring the attributes in the tables, and joining the tables to a layer of Canadian province and territory boundaries from ArcGIS Living Atlas to visualize the data on a map. You then styled the layer to show where rates of intimate partner violence are higher and lower. After styling the data, you configured pop-ups to provide more details about intimate partner violence and domestic violence shelter capacity in each Canadian province and territory.
Once you explored the data using the map, you configured a set of charts to use for further analysis. Lastly, you shared your map as a web app.
You can find more tutorials in the tutorial gallery.
