Data Commons highlight chart Web Component
Data Commons Web Component for highlighting a specific variable value from a specific variable about a single place.
Usage
<datacommons-highlight
header="Title here"
place="place_dcid"
variable="variable_dcid"
></datacommons-highlight>
Attributes
Required
Name | Type | Description |
---|---|---|
header | string | Text to show next to the variable value highlighted. |
place | type | Place DCID to plot. |
variable | type | Variable DCID to plot. |
Optional
Name | Type | Description |
---|---|---|
date | string | Specific date to show data for. ISO 8601 format (e.g. “YYYY”, “YYYY-MM”, “YYYY-MM-DD”). Note: Ensure your variable has data available at the specified date using the Stat Var Explorer Default: Most recent data available. |
unit | string | Unit the variable is measured in. |
Advanced Configuration
Name | Type | Description |
---|---|---|
apiRoot | string | Domain to make data fetch API calls from. Used primarily for fetching data from custom DCs. Default: https://datacommons.org . |
Examples
Example 1: Show percentage of US population that are internet users
Code:
<datacommons-highlight
header="Percentage of US Population that are Internet Users"
place="country/USA"
variable="Count_Person_IsInternetUser_PerCapita"
></datacommons-highlight>
Page last updated: November 27, 2024 • Send feedback about this page