{"id":5024,"date":"2017-10-28T16:30:47","date_gmt":"2017-10-28T16:30:47","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=5024"},"modified":"2022-08-13T10:27:16","modified_gmt":"2022-08-13T10:27:16","slug":"create-javascript-area-chart","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/","title":{"rendered":"How to Create JavaScript Area Chart"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5045\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg\" alt=\"How to Create a JavaScript Area Chart and Customize It\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg 1179w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5-300x186.jpg 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5-768x476.jpg 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5-1024x635.jpg 1024w\" sizes=\"(max-width: 1179px) 100vw, 1179px\" \/>Want to know how to build a JavaScript <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-types\/area-chart\/\">area chart<\/a>? This article will show you how to do that and tell you who invented area charts in the late 18th century.<\/p>\n<p>The area chart is one of the basic charts used to show changes in <a href=\"https:\/\/www.anychart.com\/chartopedia\/usage-type\/chart-to-show-data-over-time\/\">data over time<\/a>. The key feature of this chart type is a colored area between the horizontal X-axis and the line marking the changing value. It can be filled with a color, gradient color, or with a hatch fill.<\/p>\n<p>Look at the chart on the title image. That&#8217;s the data visualization\u00a0being created along the tutorial. Such a JavaScript-based area chart will be interactive and good-looking in any browser, on any website and in any app in HTML5. All samples used in the article are available in our collection <a href=\"https:\/\/codepen.io\/collection\/AWRZBy\/\" target=\"_blank\" rel=\"nofollow\">on CodePen<\/a>.<\/p>\n<p><!--more Read the JS charting tutorial \u00bb--><\/p>\n<h2>Building JavaScript Area Chart<\/h2>\n<p>Basically, there are four steps you should do to create a chart of any type. Look through this section and follow the simple steps to learn how to make an interactive HTML5 area chart like this using JavaScript:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5044\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/building-a-simple-interactive-javascript-area-chart.gif\" alt=\"JavaScript (HTML5) area chart to be created along this JS charting tutorial\" width=\"100%\" \/><\/p>\n<h3>1. Create an HTML page<\/h3>\n<p>First of all, it is necessary to create a page where your chart will be put in. The following code demonstrates how it should look like:<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;title&gt;JavaScript Area Chart&lt;\/title&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;\r\n    &lt;div id=\"container\" style=\"width: 100%; height: 100%\"&gt;&lt;\/div&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<p>The container that you see in the <code>&lt;body&gt;<\/code> section creates a container for the chart on the page. If you don&#8217;t want the chart to fill the whole HTML page, change\u00a0the\u00a0<code>width<\/code> and <code>height<\/code> parameters.<\/p>\n<h3>2. Reference all necessary files<\/h3>\n<p>The second step is about adding links into the <code>&lt;head&gt;<\/code> section. It is necessary to link\u00a0a JavaScript charting library and create a tag where the code of\u00a0the chart will be inserted:<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n  &lt;head&gt;\r\n      &lt;title&gt;JavaScript Area Chart&lt;\/title&gt;\r\n      &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.0.1\/js\/anychart-base.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;\r\n    &lt;div id=\"container\" style=\"width: 100%; height: 100%\"&gt;&lt;\/div&gt;\r\n    &lt;script&gt;\r\n        &lt;!-- chart code will be here --&gt;\r\n    &lt;\/script&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<h3>3. Put together the data<\/h3>\n<p>The most important part of any chart is data. Scottish engineer and political economist William Playfair is credited as the <a href=\"https:\/\/www.anychart.com\/blog\/2015\/12\/23\/first-area-charts-history\/\">first person in history to\u00a0implement area charts<\/a>. Playfair used\u00a0them to show the changes of Interest of the National Debt and Imports and Exports to and from England.<\/p>\n<p>Let&#8217;s do what he did, and\u00a0visualize the <b>Interest Expense on the Debt Outstanding<\/b> according to the data from <a href=\"https:\/\/www.treasurydirect.gov\/govt\/reports\/ir\/ir_expense.htm\" target=\"_blank\" rel=\"nofollow\">TreasuryDirect<\/a>:<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td style=\"padding: 15px; text-align: center;\" colspan=\"2\"><b>Interest Expense on the Debt Outstanding<\/b><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 15px; text-align: center;\"><b>Year<\/b><\/td>\n<td style=\"padding: 15px; text-align: center;\"><b>Interest Expense on the Debt<\/b>,<br \/>\nUS dollars<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2007<\/td>\n<td style=\"padding: 6px 15px;\">$429,977,998,108.20<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2008<\/td>\n<td style=\"padding: 6px 15px;\">$451,154,049,950.63<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2009<\/td>\n<td style=\"padding: 6px 15px;\">$383,071,060,815.42<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2010<\/td>\n<td style=\"padding: 6px 15px;\">$413,954,825,362.17<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2011<\/td>\n<td style=\"padding: 6px 15px;\">$454,393,280,417.03<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2012<\/td>\n<td style=\"padding: 6px 15px;\">$359,796,008,919.49<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2013<\/td>\n<td style=\"padding: 6px 15px;\">$415,688,781,248.40<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2014<\/td>\n<td style=\"padding: 6px 15px;\">$430,812,121,372.05<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2015<\/td>\n<td style=\"padding: 6px 15px;\">$402,435,356,075.49<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">2016<\/td>\n<td style=\"padding: 6px 15px;\">$432,649,652,901.12<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\nNow, let&#8217;s create the <code>data<\/code> object:<\/p>\n<pre><code class=\"js\">\/\/ set the data\r\nvar data = {\r\n  header: [\"Year\", \"Interest Expense on the Debt\"],\r\n  rows: [\r\n    [2007, 429977998108.20],\r\n    [2008, 451154049950.63],\r\n    [2009, 383071060815.42],\r\n    [2010, 413954825362.17],\r\n    [2011, 454393280417.03],\r\n    [2012, 359796008919.49],\r\n    [2013, 415688781248.40],\r\n    [2014, 430812121372.05],\r\n    [2015, 402435356075.49],\r\n    [2016, 432649652901.12]\r\n]};\r\n<\/code><\/pre>\n<h3>4. Write the code for the chart<\/h3>\n<p>This is the last step of creating a simple interactive area chart. As you can see, building charts in JavaScript is not a big deal.<\/p>\n<p>You only need to add the <code>onDocumentReady<\/code> function, like shown below:<\/p>\n<pre><code class=\"js,html\">&lt;script&gt;\r\nanychart.onDocumentReady(function() {\r\n    \/\/ the code to create an area chart will be here\r\n});\r\n&lt;\/script&gt;\r\n<\/code><\/pre>\n<p>Now, add the data into the function, create the chart and draw it into a container, and the chart is ready.<\/p>\n<pre><code class=\"js\">anychart.onDocumentReady(function() {\r\n  \/\/ set the data\r\n  var data = {\r\n    header: [\"Year\", \"Interest Expense on the Debt, USD bln.\"],\r\n    rows: [\r\n      [2007, 429],\r\n      [2008, 451],\r\n      [2009, 383],\r\n      [2010, 413],\r\n      [2011, 454],\r\n      [2012, 359],\r\n      [2013, 415],\r\n      [2014, 430],\r\n      [2015, 402],\r\n      [2016, 432]\r\n  ]};\r\n\r\n  \/\/ create the chart\r\n  var chart = anychart.area();\r\n\r\n  \/\/ add the data\r\n  chart.data(data);\r\n\r\n  chart.container('container');\r\n  chart.draw();\r\n});  \r\n<\/code><\/pre>\n<p>That&#8217;s how it looks:<\/p>\n<p class=\"codepen\" data-height=\"476\" data-theme-id=\"dark\" data-slug-hash=\"WXNXMb\" data-default-tab=\"result\" data-user=\"AnyChart\" data-embed-version=\"2\" data-pen-title=\"Creating a JavaScript Area Chart: Basic Example\">See the Pen <a href=\"https:\/\/codepen.io\/AnyChart\/pen\/WXNXMb\/\" target=\"_blank\" rel=\"nofollow\">Creating a JavaScript Area Chart: Basic Example<\/a> by AnyChart JavaScript Charts (<a href=\"https:\/\/codepen.io\/AnyChart\" target=\"_blank\" rel=\"nofollow\">@AnyChart<\/a>) on <a href=\"https:\/\/codepen.io\" target=\"_blank\" rel=\"nofollow\">CodePen<\/a>.<\/p>\n<p><script async src=\"https:\/\/production-assets.codepen.io\/assets\/embed\/ei.js\"><\/script><\/p>\n<h2>Add Chart Title<\/h2>\n<p>Chart title is not necessary but it helps to grasp the context faster. Check out\u00a0our article on\u00a0<a href=\"https:\/\/www.anychart.com\/blog\/2017\/04\/05\/chart-captions-title-graph-tips\/\">how to write a great chart caption<\/a> if you want to perfect your chart captioning skills. To\u00a0provide the chart with the title, simply add this line:<\/p>\n<pre><code class=\"js\">\/\/ set the chart title\r\nchart.title(\"Interest Expense on the Debt Outstanding\");\r\n<\/code><\/pre>\n<p>And the JavaScript area chart we&#8217;ve built becomes properly captioned:<\/p>\n<p class=\"codepen\" data-height=\"476\" data-theme-id=\"dark\" data-slug-hash=\"VrwrQG\" data-default-tab=\"result\" data-user=\"AnyChart\" data-embed-version=\"2\" data-pen-title=\"Creating a JavaScript Area Chart: Chart Title Added\">See the Pen <a href=\"https:\/\/codepen.io\/AnyChart\/pen\/VrwrQG\/\" target=\"_blank\" rel=\"nofollow\">Creating a JavaScript Area Chart: Chart Title Added<\/a> by AnyChart JavaScript Charts (<a href=\"https:\/\/codepen.io\/AnyChart\" target=\"_blank\" rel=\"nofollow\">@AnyChart<\/a>) on <a href=\"https:\/\/codepen.io\" target=\"_blank\" rel=\"nofollow\">CodePen<\/a>.<\/p>\n<p><script async src=\"https:\/\/production-assets.codepen.io\/assets\/embed\/ei.js\"><\/script><\/p>\n<h2>Tune Chart Appearance<\/h2>\n<p>Now, let&#8217;s\u00a0customize the chart design by changing the default theme of the area chart to\u00a0<code>\"sea\"<\/code>. First, we reference a file with the theme from CDN:<\/p>\n<pre><code class=\"html\">&lt;script src=\"https:\/\/cdn.anychart.com\/themes\/8.0.1\/sea.js\"&gt;&lt;\/script&gt;\r\n<\/code><\/pre>\n<p>Then, add a line of code changing the theme:<\/p>\n<pre><code class=\"js\">\/\/ set sea theme\r\nanychart.theme(\"sea\");\r\n<\/code><\/pre>\n<p>Here&#8217;s how the interactive JS area chart with\u00a0the\u00a0<code>\"sea\"<\/code> theme applied looks like:<\/p>\n<p class=\"codepen\" data-height=\"476\" data-theme-id=\"dark\" data-slug-hash=\"ooNopd\" data-default-tab=\"result\" data-user=\"AnyChart\" data-embed-version=\"2\" data-pen-title=\"Creating a JavaScript Area Chart\">See the Pen <a href=\"https:\/\/codepen.io\/AnyChart\/pen\/ooNopd\/\" target=\"_blank\" rel=\"nofollow\">Creating a JavaScript Area Chart<\/a> by AnyChart JavaScript Charts (<a href=\"https:\/\/codepen.io\/AnyChart\" target=\"_blank\" rel=\"nofollow\">@AnyChart<\/a>) on <a href=\"https:\/\/codepen.io\" target=\"_blank\" rel=\"nofollow\">CodePen<\/a>.<\/p>\n<p><script async src=\"https:\/\/production-assets.codepen.io\/assets\/embed\/ei.js\"><\/script><\/p>\n<p>Using themes makes it very easy to\u00a0modify the appearance of\u00a0a data visualization. See the list of all available themes in <a href=\"https:\/\/www.anychart.com\/products\/anychart\/themes\/\">Chart Themes Demo<\/a>.<\/p>\n<h2>Conclusion<\/h2>\n<p>This tutorial tells you how to make a beautiful, interactive HTML5 area chart\u00a0using the AnyChart JavaScript charting library. Visit the <a href=\"https:\/\/www.anychart.com\/\">AnyChart homepage<\/a> to know more about the library and other chart types you can build with it. <a href=\"https:\/\/docs.anychart.com\/\" target=\"_blank\" rel=\"nofollow\">AnyChart Documentation<\/a> and <a href=\"https:\/\/api.anychart.com\/\" target=\"_blank\" rel=\"nofollow\">AnyChart API<\/a> will help you tune your JS charts in a way you prefer.<\/p>\n<p><!-- SyntaxHighlighter \n--><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/default.min.css\"\n><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/atom-one-light.min.css\"\n><script src=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/highlight.min.js\"\n><\/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>Want to know how to build a JavaScript area chart? This article will show you how to do that and tell you who invented area charts in the late 18th century. The area chart is one of the basic charts used to show changes in data over time. The key feature of this chart type [&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":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,23,13,279,4],"tags":[53,72,73,184,283,127,44,54,32,55,144,36,141,81,57,58,65,56,30,172],"class_list":["post-5024","post","type-post","status-publish","format-standard","hentry","category-anychart-charting-component","category-html5","category-javascript","category-javascript-chart-tutorials","category-tips-and-tricks","tag-anychart","tag-area-chart","tag-area-charts","tag-chart-captions","tag-chart-title","tag-chart-types","tag-charts-and-art","tag-data-visualization","tag-html5","tag-html5-charts","tag-infographics","tag-javascript","tag-javascript-charting","tag-javascript-charting-library","tag-javascript-charts","tag-js-chart","tag-js-charting","tag-js-charts","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>JavaScript Area Chart: How to Build and Customize It<\/title>\n<meta name=\"description\" content=\"Want to know how to build an interactive JavaScript area chart? This tutorial will show and also tell you who invented area charts in the late 18th century.\" \/>\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\/2017\/10\/28\/create-javascript-area-chart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create JavaScript Area Chart\" \/>\n<meta property=\"og:description\" content=\"Want to know how to build an interactive JS area chart? This tutorial will show it &amp; tell you who invented area charts in the late 18th century.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/\" \/>\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=\"2017-10-28T16:30:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-13T10:27:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg\" \/>\n<meta name=\"author\" content=\"Timothy Loginov\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Create JavaScript Area Chart\" \/>\n<meta name=\"twitter:description\" content=\"Want to know how to build an interactive JS area chart? This tutorial will show it &amp; tell you who invented area charts in the late 18th century.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg\" \/>\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=\"Timothy Loginov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/\"},\"author\":{\"name\":\"Timothy Loginov\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6\"},\"headline\":\"How to Create JavaScript Area Chart\",\"datePublished\":\"2017-10-28T16:30:47+00:00\",\"dateModified\":\"2022-08-13T10:27:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/\"},\"wordCount\":690,\"commentCount\":3,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg\",\"keywords\":[\"AnyChart\",\"area chart\",\"area charts\",\"chart captions\",\"chart title\",\"chart types\",\"Charts and Art\",\"Data Visualization\",\"HTML5\",\"html5 charts\",\"infographics\",\"JavaScript\",\"javascript charting\",\"JavaScript charting library\",\"javascript charts\",\"js chart\",\"js charting\",\"js charts\",\"Tips and tricks\",\"tutorial\"],\"articleSection\":[\"AnyChart Charting Component\",\"HTML5\",\"JavaScript\",\"JavaScript Chart Tutorials\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/\",\"name\":\"JavaScript Area Chart: How to Build and Customize It\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg\",\"datePublished\":\"2017-10-28T16:30:47+00:00\",\"dateModified\":\"2022-08-13T10:27:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6\"},\"description\":\"Want to know how to build an interactive JavaScript area chart? This tutorial will show and also tell you who invented area charts in the late 18th century.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#primaryimage\",\"url\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg\",\"contentUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg\",\"width\":1179,\"height\":731},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create JavaScript Area Chart\"}]},{\"@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\/a944a69f34509440ab4a9b5ead73caa6\",\"name\":\"Timothy Loginov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/00860a412d134244a5234231874065a30044d4d59f78aef4cca746e1e2dd3691?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/00860a412d134244a5234231874065a30044d4d59f78aef4cca746e1e2dd3691?s=96&r=g\",\"caption\":\"Timothy Loginov\"},\"url\":\"https:\/\/www.anychart.com\/blog\/author\/timothy-loginov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript Area Chart: How to Build and Customize It","description":"Want to know how to build an interactive JavaScript area chart? This tutorial will show and also tell you who invented area charts in the late 18th century.","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\/2017\/10\/28\/create-javascript-area-chart\/","og_locale":"en_US","og_type":"article","og_title":"How to Create JavaScript Area Chart","og_description":"Want to know how to build an interactive JS area chart? This tutorial will show it & tell you who invented area charts in the late 18th century.","og_url":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2017-10-28T16:30:47+00:00","article_modified_time":"2022-08-13T10:27:16+00:00","og_image":[{"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg","type":"","width":"","height":""}],"author":"Timothy Loginov","twitter_card":"summary_large_image","twitter_title":"How to Create JavaScript Area Chart","twitter_description":"Want to know how to build an interactive JS area chart? This tutorial will show it & tell you who invented area charts in the late 18th century.","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Timothy Loginov","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/"},"author":{"name":"Timothy Loginov","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6"},"headline":"How to Create JavaScript Area Chart","datePublished":"2017-10-28T16:30:47+00:00","dateModified":"2022-08-13T10:27:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/"},"wordCount":690,"commentCount":3,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg","keywords":["AnyChart","area chart","area charts","chart captions","chart title","chart types","Charts and Art","Data Visualization","HTML5","html5 charts","infographics","JavaScript","javascript charting","JavaScript charting library","javascript charts","js chart","js charting","js charts","Tips and tricks","tutorial"],"articleSection":["AnyChart Charting Component","HTML5","JavaScript","JavaScript Chart Tutorials","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/","url":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/","name":"JavaScript Area Chart: How to Build and Customize It","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg","datePublished":"2017-10-28T16:30:47+00:00","dateModified":"2022-08-13T10:27:16+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6"},"description":"Want to know how to build an interactive JavaScript area chart? This tutorial will show and also tell you who invented area charts in the late 18th century.","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#primaryimage","url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg","contentUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2017\/10\/how-to-create-an-javascript-area-chart-for-html5.jpg","width":1179,"height":731},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2017\/10\/28\/create-javascript-area-chart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create JavaScript Area Chart"}]},{"@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\/a944a69f34509440ab4a9b5ead73caa6","name":"Timothy Loginov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/00860a412d134244a5234231874065a30044d4d59f78aef4cca746e1e2dd3691?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/00860a412d134244a5234231874065a30044d4d59f78aef4cca746e1e2dd3691?s=96&r=g","caption":"Timothy Loginov"},"url":"https:\/\/www.anychart.com\/blog\/author\/timothy-loginov\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/5024","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=5024"}],"version-history":[{"count":30,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/5024\/revisions"}],"predecessor-version":[{"id":15485,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/5024\/revisions\/15485"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=5024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=5024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=5024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}