{"id":16528,"date":"2023-05-18T19:37:26","date_gmt":"2023-05-18T19:37:26","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=16528"},"modified":"2023-05-18T22:49:30","modified_gmt":"2023-05-18T22:49:30","slug":"choropleth-map-javascript","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/","title":{"rendered":"How to Build Choropleth Map with JavaScript"},"content":{"rendered":"<p><a href=\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/\"><img decoding=\"async\" class=\"alignnone size-full wp-image-16533\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png\" alt=\"Choropleth Map with JavaScript\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png 1500w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial-300x169.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial-768x432.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial-1024x575.png 1024w\" sizes=\"(max-width: 1500px) 100vw, 1500px\" \/><\/a>Are you ready to learn how to create a choropleth map with JavaScript like a boss? Maps are a powerful way to visualize data, but building one from scratch can be a daunting task. Don&#8217;t worry, I&#8217;m here to help!<\/p>\n<p>In this tutorial, I&#8217;ll guide you through the process of building a JavaScript choropleth map step by step. And to make things more interesting, we\u2019ll use Queen Elizabeth II&#8217;s state visits as an example to showcase the power of this type of map.<\/p>\n<p>Get ready to impress yourself and your audience with stunning data visualizations, and let&#8217;s get started on this exciting journey together!<\/p>\n<p><!--more Read the JS charting tutorial \u00bb--><\/p>\n<h2>What Is a Choropleth Map?<\/h2>\n<p>A choropleth map is a type of thematic <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/choropleth-map\/\">map that uses color to represent values<\/a> of a specific quantity within different regions or geopolitical areas. The map is divided into areas or polygons, and the color of each area represents the value of the data being visualized. Typically, darker shades of a color indicate higher values, while lighter shades represent lower values.<\/p>\n<p>So as I mentioned, in this tutorial we&#8217;ll be creating a JS-based choropleth map to showcase Queen Elizabeth II&#8217;s state visits around the world. By using different colors to represent the number of visits in each region, we can easily identify which areas the Queen visited the most frequently. The final interactive choropleth map will look like this:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-16534\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-js-final.png\" alt=\"JS-based choropleth map to showcase Queen Elizabeth II's state visits around the world\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-js-final.png 1208w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-js-final-300x161.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-js-final-768x411.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-js-final-1024x548.png 1024w\" sizes=\"(max-width: 1208px) 100vw, 1208px\" \/><\/p>\n<h2>How to Build a Basic Choropleth Map<\/h2>\n<p>Creating a choropleth map with JavaScript may seem challenging, but fear not! There are just four simple steps to follow:<\/p>\n<ol>\n<li>Set up an HTML page to display the map.<\/li>\n<li>Add all the necessary JavaScript files.<\/li>\n<li>Include the data.<\/li>\n<li>Write the required JavaScript code to render the map.<\/li>\n<\/ol>\n<p>Once you&#8217;ve completed these four steps, you&#8217;ll have a beautiful choropleth map that accurately represents your data. So let&#8217;s dive into each step in more detail and learn how to easily create a stunning JavaScript choropleth map!<\/p>\n<h3>1. Set up an HTML page to display the choropleth map<\/h3>\n<p>To start creating the choropleth map, the first step is to set up an HTML page with a <code>div<\/code> element and give it a unique ID to reference it later.<\/p>\n<p>I\u2019ll set the width and height of the <code>div<\/code> element to 100% to render the map on the whole page, but you can adjust these values to suit your needs. This <code>div<\/code> element will be the container for the chart, and the ID will be used to reference it in the JavaScript code. So, let&#8217;s get started by creating the HTML page for the upcoming choropleth map!<\/p>\n<pre><code lang=\"text\/html\">&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;title&gt;JavaScript Choropleth Map&lt;\/title&gt;\r\n    &lt;style type=\"text\/css\"&gt;      \r\n      html, body, #container { \r\n        width: 100%; height: 100%; margin: 0; padding: 0; \r\n      } \r\n    &lt;\/style&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;\r\n    &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h3>2. Add all the necessary JavaScript files<\/h3>\n<p>To easily create data visualizations for the web, I use a JavaScript charting library with in-built utilities and functions. With the <a href=\"https:\/\/dzone.com\/articles\/10-best-javascript-charting-libraries-for-any-data\" target=\"_blank\" rel=\"nofollow\">vast number<\/a> of such JS libraries available, the process for creating charts and maps is similar in essence and logic across most of them. In this tutorial, I am using the <a href=\"https:\/\/www.anychart.com\">AnyChart<\/a> JS charting library as it is beginner-friendly with extensive documentation and plenty of examples to help you get started.<\/p>\n<p>It is needed to link the required JS scripts in the <code>&lt;head&gt;<\/code> section of the HTML page. These scripts include the Core and Geo Maps modules and the file that contains geodata for the world map, all of which are available on the CDN. I&#8217;ll also use two more script files to connect the data to the choropleth map. One is the Data Adapter, which will help load the data, and the other is <a href=\"http:\/\/proj4js.org\/\" target=\"_blank\" rel=\"nofollow\">Proj4js<\/a>, a JavaScript library that will transform the coordinates from one coordinate system to another so the data can be plotted on the map accurately.<\/p>\n<pre><code lang=\"text\/html\">&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;title&gt;JavaScript Choropleth Map&lt;\/title&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-map.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/geodata\/custom\/world\/world.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/proj4js\/2.3.15\/proj4.js\"&gt;&lt;\/script&gt;\r\n    &lt;style type=\"text\/css\"&gt;      \r\n      html, body, #container { \r\n        width: 100%; height: 100%; margin: 0; padding: 0; \r\n      } \r\n    &lt;\/style&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;  \r\n    &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n    &lt;script&gt;\r\n      \/\/ All the code for the JS choropleth map will come here\r\n    &lt;\/script&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h3>3. Include the data<\/h3>\n<p>Alright, let&#8217;s get the data loaded up and plotted on the JS choropleth map! First things first, I have collected the data on the state visits made by Queen Elizabeth II from <a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_state_visits_made_by_Elizabeth_II\" target=\"_blank\" rel=\"nofollow\">Wikipedia<\/a> and put it in a JSON file for easy access. You can find it <a href=\"https:\/\/gist.githubusercontent.com\/shacheeswadia\/8f45da54d9bf2032fee201dbfc79e0e4\/raw\/5d10d58f40b4a1d994cef36dbc64545ef90ead80\/queenVisits.json\" target=\"_blank\" rel=\"nofollow\">here<\/a>.<\/p>\n<p>All the necessary files are already linked in the <code>&lt;head&gt;<\/code> section of the HTML page. So it\u2019s possible to use the <code>loadJsonFile()<\/code> method inside a <code>&lt;script&gt;<\/code> tag in the body of the page to load the JSON file containing the Queen&#8217;s state visits data.<\/p>\n<pre><code lang=\"text\/javascript\">anychart.data.loadJsonFile(&lt;fileURL&gt;, function (data) {});<\/code><\/pre>\n<p>Great! Now that everything is set up and ready to go, it&#8217;s time to move on to the main part of the journey: creating the choropleth map visualization! Let&#8217;s do this!<\/p>\n<h3>4. Write the required JavaScript code to render the map<\/h3>\n<p>You can get the choropleth map rendered with just a few lines of JS code. First, make sure that all the code is inside the function <code>anychart.onDocumentReady()<\/code> so that the page is fully loaded before executing anything else. Once the data file is loaded, set the data, create the map, and set the geodata.<\/p>\n<pre><code lang=\"text\/html\">&lt;script&gt;\r\n\r\n  anychart.onDocumentReady(function() {\r\n\r\n    \/\/ load data from a json file\r\n    anychart.data.loadJsonFile('https:\/\/gist.githubusercontent.com\/shacheeswadia\/8f45da54d9bf2032fee201dbfc79e0e4\/raw\/5d10d58f40b4a1d994cef36dbc64545ef90ead80\/queenVisits.json',\r\n    function (data) {\r\n    \r\n      \/\/ create a dataset\r\n      let dataSet = anychart.data.set(data);\r\n\r\n      \/\/ create a map instance\r\n      let map = anychart.map();\r\n\r\n      \/\/ set the geodata\r\n      map.geoData(\"anychart.maps.world\");\r\n\r\n      \/\/ the rest of the JS code will be here\r\n\t\r\n    });\r\n\r\n  });\r\n\r\n&lt;\/script&gt;<\/code><\/pre>\n<p>Now, create a series with the <code>choropleth()<\/code> function and the loaded data. For the coloring, let\u2019s set up a linear color scale with four different shades of blue based on the colors on the royal website. As per convention, the darker the shade of a country, the higher the number of visits to that region.<\/p>\n<pre><code lang=\"text\/javascript\">\/\/ create a choropleth series\r\nlet series = map.choropleth(dataSet);\r\n\r\n\/\/ set the map colors\r\nseries\r\n  .colorScale(\r\n     anychart.scales.linearColor(\"#f2f2f2\", \"#42a5f5\", \"#1976d2\", \"#233580\")\r\n   );<\/code><\/pre>\n<p>Finally, give a title to the map, set the container, and draw the resulting map.<\/p>\n<pre><code lang=\"text\/javascript\">\/\/ set the map title\r\nmap.title(\"State Visits Made by Queen Elizabeth II\");\r\n\r\n\/\/ set the container\r\nmap.container('container');\r\n\r\n\/\/ initiate the map drawing\r\nmap.draw();<\/code><\/pre>\n<p>And voila! A beautiful and functional choropleth map is ready! Check out how it looks. You can find the entire code below or view and play with it <a href=\"https:\/\/playground.anychart.com\/JMwphXGM\" target=\"_blank\" rel=\"nofollow\">here<\/a>.<\/p>\n<p><iframe sandbox=\"allow-scripts allow-pointer-lock allow-same-origin\n                 allow-popups allow-modals allow-forms\" frameBorder=\"0\" class=\"anychart-embed anychart-embed-JMwphXGM\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/JMwphXGM\/iframe\"><br \/>\n<\/iframe><br \/>\n<script type=\"text\/javascript\">(function(){\nfunction ac_add_to_head(el){\n\tvar head = document.getElementsByTagName('head')[0];\n\thead.insertBefore(el,head.firstChild);\n}\nfunction ac_add_style(css){\n\tvar ac_style = document.createElement('style');\n\tif (ac_style.styleSheet) ac_style.styleSheet.cssText = css;\n\telse ac_style.appendChild(document.createTextNode(css));\n\tac_add_to_head(ac_style);\n}\nac_add_style(\".anychart-embed-JMwphXGM{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<pre><code lang=\"text\/html\">&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;title&gt;JavaScript Choropleth Map&lt;\/title&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-map.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/geodata\/custom\/world\/world.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/proj4js\/2.3.15\/proj4.js\"&gt;&lt;\/script&gt;\r\n    &lt;style type=\"text\/css\"&gt;      \r\n      html, body, #container { \r\n        width: 100%; height: 100%; margin: 0; padding: 0; \r\n      } \r\n    &lt;\/style&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;  \r\n    &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n    &lt;script&gt;\r\n      anychart.onDocumentReady(function () {\r\n        \/\/ load data from a json file\r\n        anychart.data.loadJsonFile(\r\n          \"https:\/\/gist.githubusercontent.com\/shacheeswadia\/8f45da54d9bf2032fee201dbfc79e0e4\/raw\/5d10d58f40b4a1d994cef36dbc64545ef90ead80\/queenVisits.json\",\r\n          function (data) {\r\n            \/\/ create a dataset\r\n            let dataSet = anychart.data.set(data);\r\n            \/\/ create a map instance\r\n            let map = anychart.map();\r\n            \/\/ set the geodata\r\n            map.geoData(\"anychart.maps.world\");\r\n            \/\/ create a choropleth series\r\n            let series = map.choropleth(dataSet);\r\n            \/\/ set the map colors\r\n            series\r\n              .colorScale(\r\n                anychart.scales.linearColor(\"#f2f2f2\", \"#42a5f5\", \"#1976d2\", \"#233580\")\r\n              );\r\n            \/\/ set the map title\r\n            map.title(\"State Visits Made by Queen Elizabeth II\");\r\n            \/\/ set the container\r\n            map.container(\"container\");\r\n            \/\/ initiate the map drawing\r\n            map.draw();\r\n          }\r\n        );\r\n      });\r\n    &lt;\/script&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2>How to Customize a Choropleth Map<\/h2>\n<p>The existing choropleth map is already impressive, but let me show you how to make it even more insightful and engaging! In the following steps, I&#8217;ll demonstrate how you can customize the choropleth map to add more visual appeal and interactivity:<\/p>\n<ol>\n<li>Modify the colors on hover over map areas.<\/li>\n<li>Add a color legend.<\/li>\n<li>Improve the tooltip and the title format.<\/li>\n<li>Add zoom controls.<\/li>\n<\/ol>\n<h3>1. Modify the colors on hovering over the areas<\/h3>\n<p>You can make the map more visually appealing by modifying the colors of the hovered regions. By default, hovered regions become gray, but you can change this to a darker shade of the base color to make it more intuitive. This can be achieved by changing the fill color of the region when it is hovered and using the <code>darken()<\/code> function.<\/p>\n<pre><code lang=\"text\/javascript\">series\r\n  .hovered()\r\n  .fill(function (d) {\r\n    return anychart.color.darken(d.sourceColor, 0.2);\r\n  });<\/code><\/pre>\n<h3>2. Add a color legend<\/h3>\n<p>Adding a color legend to your choropleth map is always a great idea, as it can help your audience understand the values and colors used in the map.<\/p>\n<p>To add a color legend, you only need to enable the color range. This will automatically create a legend that represents what color indicates what value. By default, the color range is disabled. To enable it, you just need to add a few lines of code:<\/p>\n<pre><code lang=\"text\/javascript\">map.colorRange()\r\n  .enabled(true);<\/code><\/pre>\n<p>And voila! You now have a beautiful and informative color legend to complement your choropleth map.<\/p>\n<h3>3. Improve the tooltip and title format<\/h3>\n<p>Let&#8217;s take the choropleth map to the next level by improving the tooltip and the title format. Tooltips are a powerful way to showcase additional information, and they can be made even better by enabling HTML for customizing the tooltip and formatting the value.<\/p>\n<p>I thought it would be nice to add a custom text and indicate how many times the Queen visited the hovered country. Additionally, the specific case of the United Kingdom can be handled to showcase that the Queen lived there.<\/p>\n<p>With these changes, the tooltip is not only more informative but also more visually appealing. The users will enjoy the playful tone of the tooltip while learning interesting facts about the Queen&#8217;s travels.<\/p>\n<pre><code lang=\"text\/javascript\">series\r\n  .tooltip() \r\n  .useHtml(true)\r\n  .format(function (d) {\r\n    if (d.name == \"United Kingdom\") {\r\n      return \"&lt;h6 style='font-size:14px; font-weight:400; margin: 0.2rem 0;'&gt;The Queen lived here.&lt;\/h6&gt;\";\r\n    } else {\r\n      return (\r\n        \"&lt;h6 style='font-size:14px; font-weight:400; margin: 0.2rem 0;'&gt;The Queen visited &lt;b&gt;\" +\r\n          d.value + \"&lt;\/b&gt; times.&lt;\/h6&gt;\"\r\n      );\r\n    }\r\n  });<\/code><\/pre>\n<p>In addition to customizing the tooltip, why not enhance the chart title using HTML? For example, a subtitle will provide more context, and custom text styling will make it all shine.<\/p>\n<pre><code lang=\"text\/javascript\">map\r\n  .title()\r\n  .enabled(true)\r\n  .useHtml(true)\r\n  .text(\r\n    '&lt;span style=\"color: #c8102e; font-size:18px;\"&gt;State visits made by Queen Elizabeth II&lt;\/span&gt;' +\r\n      '&lt;span style=\"font-size: 15px;\"&gt;The Queen is the most widely traveled head of state in history&lt;\/span&gt;'\r\n  );<\/code><\/pre>\n<h3>4. Add zoom controls<\/h3>\n<p>Adding zoom controls to a world map can be a great way to allow users to zoom into specific areas of interest. To get started, add the required scripts and CSS links to your HTML document&#8217;s <code>&lt;head&gt;<\/code> section. Once you have done this, you can create the zoom controls and render them on the map with just a few lines of code.<\/p>\n<pre><code lang=\"text\/html\">&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-exports.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-ui.min.js\"&gt;&lt;\/script&gt;\r\n\r\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/css\/anychart-ui.min.css\"&gt;\r\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/fonts\/css\/anychart-font.min.css\"&gt;<\/code><\/pre>\n<pre><code lang=\"text\/javascript\">var zoomController = anychart.ui.zoom();\r\nzoomController.render(map);<\/code><\/pre>\n<p dir=\"ltr\">It&#8217;s worth noting that the zoom feature can be particularly useful when working with large and detailed choropleth maps. In this case, it can be a great way to allow users to explore specific regions or areas of interest in more detail.<\/p>\n<p dir=\"ltr\">And now just sit back and admire your beautiful JavaScript choropleth map! With the addition of customized colors, a color legend, improved tooltips and title, and zoom controls, it\u2019s an interactive and engaging visualization that is sure to impress. See the complete code for this project below and feel free to play with it and see the choropleth map\u2019s full interactive version live <a href=\"https:\/\/playground.anychart.com\/ZNj2y3mT\" target=\"_blank\" rel=\"nofollow\">here<\/a>.<\/p>\n<p><iframe sandbox=\"allow-scripts allow-pointer-lock allow-same-origin\n                 allow-popups allow-modals allow-forms\" frameBorder=\"0\" class=\"anychart-embed anychart-embed-ZNj2y3mT\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/ZNj2y3mT\/iframe\"><br \/>\n<\/iframe><br \/>\n<script type=\"text\/javascript\">(function(){\nfunction ac_add_to_head(el){\n\tvar head = document.getElementsByTagName('head')[0];\n\thead.insertBefore(el,head.firstChild);\n}\nfunction ac_add_style(css){\n\tvar ac_style = document.createElement('style');\n\tif (ac_style.styleSheet) ac_style.styleSheet.cssText = css;\n\telse ac_style.appendChild(document.createTextNode(css));\n\tac_add_to_head(ac_style);\n}\nac_add_style(\".anychart-embed-ZNj2y3mT{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<pre><code lang=\"text\/html\">&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;title&gt;JavaScript Choropleth Map&lt;\/title&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-map.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/geodata\/custom\/world\/world.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/proj4js\/2.3.15\/proj4.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-exports.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-ui.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/css\/anychart-ui.min.css\"&gt;\r\n    &lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/fonts\/css\/anychart-font.min.css\"&gt;\r\n    &lt;style type=\"text\/css\"&gt;      \r\n      html, body, #container { \r\n        width: 100%; height: 100%; margin: 0; padding: 0; \r\n      } \r\n    &lt;\/style&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;  \r\n    &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n    &lt;script&gt;\r\n      anychart.onDocumentReady(function () {\r\n        \/\/ load data from a json file\r\n        anychart.data.loadJsonFile(\r\n          \"https:\/\/gist.githubusercontent.com\/shacheeswadia\/8f45da54d9bf2032fee201dbfc79e0e4\/raw\/5d10d58f40b4a1d994cef36dbc64545ef90ead80\/queenVisits.json\",\r\n          function (data) {\r\n            \/\/ create a dataset\r\n            let dataSet = anychart.data.set(data);\r\n            \/\/ create a map instance\r\n            let map = anychart.map();\r\n            \/\/ set the geodata\r\n            map.geoData(\"anychart.maps.world\");\r\n            \/\/ create a choropleth series\r\n            let series = map.choropleth(dataSet);\r\n            \/\/ set the map colors\r\n            series.colorScale(\r\n              anychart.scales.linearColor(\"#f2f2f2\", \"#42a5f5\", \"#1976d2\", \"#233580\")\r\n            );\r\n            \/\/ customize the colors in the hovered state\r\n            series.hovered().fill(function (d) {\r\n              return anychart.color.darken(d.sourceColor, 0.2);\r\n            });\r\n            \/\/ create the map legend\r\n            map.colorRange().enabled(true);\r\n            \/\/ create zoom controls\r\n            let zoomController = anychart.ui.zoom();\r\n            zoomController.render(map);\r\n            \/\/ customize the tooltip text\r\n            series\r\n              .tooltip()\r\n              .useHtml(true)\r\n              .format(function (d) {\r\n                if (d.name == \"United Kingdom\") {\r\n                  return \"&lt;h6 style='font-size:14px; font-weight:400; margin: 0.2rem 0;'&gt;The Queen lived here.&lt;\/h6&gt;\";\r\n                } else {\r\n                  return (\r\n                    \"&lt;h6 style='font-size:14px; font-weight:400; margin: 0.2rem 0;'&gt;The Queen visited &lt;b&gt;\" +\r\n                    d.value +\r\n                    \"&lt;\/b&gt; times.&lt;\/h6&gt;\"\r\n                  );\r\n                }\r\n              });\r\n            \/\/ set the map title\r\n            map\r\n              .title()\r\n              .enabled(true)\r\n              .useHtml(true)\r\n              .text(\r\n                '&lt;span style = \"color: #c8102e; font-size:18px;\"&gt;State Visits Made by Queen Elizabeth II&lt;\/span&gt;' +\r\n                  '&lt;br\/&gt;&lt;span style=\"font-size: 15px;\"&gt;The Queen is the most widely traveled head of state in history&lt;\/span&gt;'\r\n              );\r\n            \/\/ set the container\r\n            map.container(\"container\");\r\n            \/\/ initiate the map drawing\r\n            map.draw();\r\n          }\r\n        );\r\n      });\r\n    &lt;\/script&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2 dir=\"ltr\">Conclusion<\/h2>\n<p>\u0421horopleth maps are a powerful tool for visualizing data on a geographic scale. Using JavaScript, you can create stunning interactive ones that communicate complex information in a clear and concise manner.<\/p>\n<p>Whether you&#8217;re tracking the travels of a monarch or visualizing the spread of a pandemic, the possibilities are endless. So, let your imagination run wild and start exploring the world through the lens of data!<\/p>\n<hr \/>\n<p><strong><em>Published with the permission of Shachee Swadia. Originally appeared on <a href=\"https:\/\/dzone.com\/articles\/choropleth-map-javascript\" target=\"_blank\" rel=\"nofollow\">DZone<\/a> with the title &#8220;Creating a Choropleth Map With JavaScript&#8221; on May 9, 2023.<\/p>\n<p>You may also like to see the <a href=\"https:\/\/www.anychart.com\/blog\/2020\/05\/06\/javascript-choropleth-map-tutorial\/\">JavaScript Choropleth Map Tutorial<\/a> produced by Anastasia Zoumpliou especially for our blog and originally published here earlier.<\/p>\n<p>Check out more <a href=\"https:\/\/www.anychart.com\/blog\/category\/javascript-chart-tutorials\/\">JavaScript charting tutorials<\/a> on our blog.<\/p>\n<p>Have an idea for a cool guest post? <a href=\"https:\/\/www.anychart.com\/support\/\">Drop us a line!<\/a><\/strong><\/p>\n<hr \/>\n<p><!-- SyntaxHighlighter --><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/default.min.css\"><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/atom-one-light.min.css\"><script src=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/highlight.min.js\"><\/script><script>hljs.initHighlightingOnLoad();<\/script><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Are you ready to learn how to create a choropleth map with JavaScript like a boss? Maps are a powerful way to visualize data, but building one from scratch can be a daunting task. Don&#8217;t worry, I&#8217;m here to help! In this tutorial, I&#8217;ll guide you through the process of building a JavaScript choropleth map [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,66,23,13,279,4],"tags":[53,260,284,127,258,732,104,471,266,620,509,2906,54,1389,1760,256,1111,165,313,1370,774,3529,2652,1528,2050,236,1762,32,55,144,36,907,141,81,57,2904,58,65,56,2655,2654,237,3541,131,459,30,172],"class_list":["post-16528","post","type-post","status-publish","format-standard","hentry","category-anychart-charting-component","category-anymap","category-html5","category-javascript","category-javascript-chart-tutorials","category-tips-and-tricks","tag-anychart","tag-best-data-visualization-examples","tag-chart-examples","tag-chart-types","tag-charts","tag-choropleth-map","tag-choropleth-maps","tag-data-analysis","tag-data-analytics","tag-data-analytics-examples","tag-data-graphics","tag-data-mapping","tag-data-visualization","tag-data-visualization-best-pracices","tag-data-visualization-design","tag-data-visualization-examples","tag-data-visualization-practice","tag-data-visualizations","tag-data-visuals","tag-data-viz-examples","tag-dataviz-examples","tag-geo-map","tag-geodata","tag-geography","tag-geospatial-analysis","tag-geovisualization","tag-guest-post","tag-html5","tag-html5-charts","tag-infographics","tag-javascript","tag-javascript-chart-tutorial","tag-javascript-charting","tag-javascript-charting-library","tag-javascript-charts","tag-javascript-map-tutorial","tag-js-chart","tag-js-charting","tag-js-charts","tag-js-mapping","tag-mapping","tag-maps","tag-queen-elizabeth","tag-recap-of-the-week","tag-statistics","tag-tips-and-tricks","tag-tutorial","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What Is &amp; How to Build a Choropleth Map Using JavaScript<\/title>\n<meta name=\"description\" content=\"Master JavaScript choropleth maps and impress with Queen Elizabeth II&#039;s state visits data visualization. Level up your web mapping skills!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Build a Choropleth Map with JavaScript\" \/>\n<meta property=\"og:description\" content=\"Master JavaScript choropleth maps and impress with Queen Elizabeth II&#039;s state visits data visualization. Level up your web mapping skills!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"AnyChart News\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AnyCharts\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-18T19:37:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-18T22:49:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial-social.png\" \/>\n<meta name=\"author\" content=\"Shachee Swadia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Build a Choropleth Map with JavaScript\" \/>\n<meta name=\"twitter:description\" content=\"Master JavaScript choropleth maps and impress with Queen Elizabeth II&#039;s state visits data visualization. Level up your web mapping skills!\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial-social.png\" \/>\n<meta name=\"twitter:creator\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:site\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Shachee Swadia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/\"},\"author\":{\"name\":\"Shachee Swadia\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51\"},\"headline\":\"How to Build Choropleth Map with JavaScript\",\"datePublished\":\"2023-05-18T19:37:26+00:00\",\"dateModified\":\"2023-05-18T22:49:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/\"},\"wordCount\":1607,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png\",\"keywords\":[\"AnyChart\",\"best data visualization examples\",\"chart examples\",\"chart types\",\"charts\",\"choropleth map\",\"choropleth maps\",\"data analysis\",\"data analytics\",\"data analytics examples\",\"data graphics\",\"data mapping\",\"Data Visualization\",\"data visualization best practices\",\"data visualization design\",\"data visualization examples\",\"data visualization practice\",\"data visualizations\",\"data visuals\",\"data viz examples\",\"dataviz examples\",\"geo map\",\"geodata\",\"geography\",\"geospatial analysis\",\"geovisualization\",\"guest post\",\"HTML5\",\"html5 charts\",\"infographics\",\"JavaScript\",\"javascript chart tutorial\",\"javascript charting\",\"JavaScript charting library\",\"javascript charts\",\"javascript map tutorial\",\"js chart\",\"js charting\",\"js charts\",\"js mapping\",\"mapping\",\"maps\",\"Queen Elizabeth\",\"recap of the week\",\"statistics\",\"Tips and tricks\",\"tutorial\"],\"articleSection\":[\"AnyChart Charting Component\",\"AnyMap\",\"HTML5\",\"JavaScript\",\"JavaScript Chart Tutorials\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/\",\"name\":\"What Is & How to Build a Choropleth Map Using JavaScript\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png\",\"datePublished\":\"2023-05-18T19:37:26+00:00\",\"dateModified\":\"2023-05-18T22:49:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51\"},\"description\":\"Master JavaScript choropleth maps and impress with Queen Elizabeth II's state visits data visualization. Level up your web mapping skills!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#primaryimage\",\"url\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png\",\"contentUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png\",\"width\":1500,\"height\":843},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Build Choropleth Map with JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\",\"url\":\"https:\/\/www.anychart.com\/blog\/\",\"name\":\"AnyChart News\",\"description\":\"AnyChart JS Charts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.anychart.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51\",\"name\":\"Shachee Swadia\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/50ebd5c61e4e46e052898a5ddbcef5996666132cf07c614be4725f028ec7eae3?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/50ebd5c61e4e46e052898a5ddbcef5996666132cf07c614be4725f028ec7eae3?s=96&r=g\",\"caption\":\"Shachee Swadia\"},\"url\":\"https:\/\/www.anychart.com\/blog\/author\/shachee-swadia\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Is & How to Build a Choropleth Map Using JavaScript","description":"Master JavaScript choropleth maps and impress with Queen Elizabeth II's state visits data visualization. Level up your web mapping skills!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/","og_locale":"en_US","og_type":"article","og_title":"How to Build a Choropleth Map with JavaScript","og_description":"Master JavaScript choropleth maps and impress with Queen Elizabeth II's state visits data visualization. Level up your web mapping skills!","og_url":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2023-05-18T19:37:26+00:00","article_modified_time":"2023-05-18T22:49:30+00:00","og_image":[{"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial-social.png","type":"","width":"","height":""}],"author":"Shachee Swadia","twitter_card":"summary_large_image","twitter_title":"How to Build a Choropleth Map with JavaScript","twitter_description":"Master JavaScript choropleth maps and impress with Queen Elizabeth II's state visits data visualization. Level up your web mapping skills!","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial-social.png","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Shachee Swadia","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/"},"author":{"name":"Shachee Swadia","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51"},"headline":"How to Build Choropleth Map with JavaScript","datePublished":"2023-05-18T19:37:26+00:00","dateModified":"2023-05-18T22:49:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/"},"wordCount":1607,"commentCount":0,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png","keywords":["AnyChart","best data visualization examples","chart examples","chart types","charts","choropleth map","choropleth maps","data analysis","data analytics","data analytics examples","data graphics","data mapping","Data Visualization","data visualization best practices","data visualization design","data visualization examples","data visualization practice","data visualizations","data visuals","data viz examples","dataviz examples","geo map","geodata","geography","geospatial analysis","geovisualization","guest post","HTML5","html5 charts","infographics","JavaScript","javascript chart tutorial","javascript charting","JavaScript charting library","javascript charts","javascript map tutorial","js chart","js charting","js charts","js mapping","mapping","maps","Queen Elizabeth","recap of the week","statistics","Tips and tricks","tutorial"],"articleSection":["AnyChart Charting Component","AnyMap","HTML5","JavaScript","JavaScript Chart Tutorials","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/","url":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/","name":"What Is & How to Build a Choropleth Map Using JavaScript","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png","datePublished":"2023-05-18T19:37:26+00:00","dateModified":"2023-05-18T22:49:30+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51"},"description":"Master JavaScript choropleth maps and impress with Queen Elizabeth II's state visits data visualization. Level up your web mapping skills!","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#primaryimage","url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png","contentUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/05\/choropleth-map-tutorial.png","width":1500,"height":843},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2023\/05\/18\/choropleth-map-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Build Choropleth Map with JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/www.anychart.com\/blog\/#website","url":"https:\/\/www.anychart.com\/blog\/","name":"AnyChart News","description":"AnyChart JS Charts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.anychart.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51","name":"Shachee Swadia","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/50ebd5c61e4e46e052898a5ddbcef5996666132cf07c614be4725f028ec7eae3?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/50ebd5c61e4e46e052898a5ddbcef5996666132cf07c614be4725f028ec7eae3?s=96&r=g","caption":"Shachee Swadia"},"url":"https:\/\/www.anychart.com\/blog\/author\/shachee-swadia\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/16528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=16528"}],"version-history":[{"count":15,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/16528\/revisions"}],"predecessor-version":[{"id":16613,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/16528\/revisions\/16613"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=16528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=16528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=16528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}