Display Census Data as Heatmaps
Contents
Overview
This article introduces a sample customization using Amcharts5 . The sample displays the record list in a US Census App in the form of a heatmap:
- The colors set in the heatmap will vary according to the value of the
population
field of the Census App. - The heatmap will be displayed on the Header Space Element of the App, which lies above the list of records.
Sample Image
The heatmap is displayed when the user navigates to the Record List page of the App.
Prepare the App
Create the form
Create an App with the following fields.
Field Type | Field Name | Field Code | Notes |
---|---|---|---|
Text | State | state | |
Text | Code | code | |
Number | Population | population |
Populate the App with Data
The map needs to be populated with data. One convenient way is to import large amounts of data via a CSV file. Create a CSV file in the following format:
|
|
The CSV can then be imported from the list of records page. For more information on importing record data from files, refer to the Importing Record Data from a File into an App article.
Set up the JavaScript Settings
This example uses the Amcharts5 CDN. For more information on the specific JavaScript libraries offered, refer to the Amcharts5 Download Page . Set the following URLs into the Upload JavaScript/CSS Files for PC option of the App's JavaScript and CSS Customization settings .
https://cdn.amcharts.com/lib/5/index.js
https://cdn.amcharts.com/lib/5/map.js
https://cdn.amcharts.com/lib/5/themes/Animated.js
https://cdn.amcharts.com/lib/5/geodata/usaLow.js
Sample Code
Set the JavaScript file
Prepare the following JavaScript code in a text editor and navigate to the Kintone App's settings. Upload the file into the Upload JavaScript/CSS Files for PC option of the JavaScript and CSS Customization settings .
|
|
Update the Settings
The files set in the JavaScript and CSS Customization settings should look like the following.
Attention
The order in which JavaScript and CSS are uploaded to an app matters. In this example, ensure that the Amcharts5 libraries are uploaded before the sample JavaScript file. The order of the uploads can be changed by clicking and dragging on the arrows for each item on the Upload JavaScript / CSS page.
Click Save, and then on Update App. Navigate to any view inside the Kintone App, a heatmap of the United States population should be displayed above the record data for the app.