# Visualize location and IP data

Visualize IP addresses, airports, cities, and countries on a map using our built-in location mapping.

## Create your first map chart


1. Create a new chart and select **Chart** -> **Map** in right sidebar. 

2. Pick a numeric column to visualize on the map and drag it to **Value**.

3. Drag an IP address or other location column to **Location**.

You should see your IP addresses rendered on a map below. 

![Map chart.png](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/361bf1bc-c2b3-4b12-f6f4-c64446b93400/orig =1585x949)


## Create a map chart using SQL

Here's an SQL example visualizing CloudFlare request rate by location: 

```sql
[label Visualize IP addresses via SQL]
SELECT
  avgMerge(rate_avg) AS value,
  location(metricTag('colo')) AS location
FROM {{source}}
WHERE
  name = 'cloudflare_zone_colocation_requests_total'
  AND dt BETWEEN {{start_time}} AND {{end_time}}
GROUP BY location
```

### Want to show IPs on the map?

Open the right sidebar on your chart and select **Data** -> **Location label** -> **Original value**.
Now, the tooltips will show your data directly instead of the closest city.

![Map chart showing IP addresses.png](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/66d3af41-da1e-4ffd-e03c-a73b85c04c00/orig =1595x960)

[success]
#### Need to visualize airports, cities, or countries?

Location in query builder and `location()` in SQL both accept many location formats.
Use "1.1.1.1", "JFK", "San Francisco, CA", "London, UK", or "US".
[/success]


## Need help?

Please let us know at hello@betterstack.com.  
We're happy to help! 🙏

