{"id":20439,"date":"2026-04-09T00:59:00","date_gmt":"2026-04-09T00:59:00","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=20439"},"modified":"2026-04-10T09:55:15","modified_gmt":"2026-04-10T09:55:15","slug":"javascript-vertical-area-chart","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/","title":{"rendered":"How to Create a JavaScript Vertical Area Chart"},"content":{"rendered":"<p><a href=\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/\" target=\"_blank\"><img decoding=\"async\" class=\"alignnone size-full wp-image-20551\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png\" alt=\"JavaScript vertical area chart showing U.S. presidential approval ratings on a laptop screen in the Oval Office\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png 1536w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings-300x191.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings-1024x653.png 1024w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings-768x490.png 768w\" sizes=\"(max-width: 1536px) 100vw, 1536px\" \/><\/a>Traditionally, charts that visualize <a href=\"https:\/\/www.anychart.com\/chartopedia\/usage-type\/chart-to-show-data-over-time\/\" target=\"_blank\">data over time<\/a> are horizontal. But sometimes a vertical layout is a better fit. In this tutorial, you will learn how to create an interactive vertical area chart using JavaScript step by step.<\/p>\n<p>The practical example uses monthly approval and disapproval ratings of American presidents from 1941 to 2025, according to Gallup polls. The final chart shows over 80 years of public support and opposition across U.S. administrations as two mirrored area series running top to bottom.<\/p>\n<p><!--more Read the JS charting tutorial \u00bb--><\/p>\n<p>The result will look like this:<\/p>\n<p><a href=\"https:\/\/playground.anychart.com\/jIH6T1XH\" target=\"_blank\" rel=\"nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-20554\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/final-javascript-vertical-area-chart-scaled.png\" alt=\"Preview of the JavaScript vertical area chart built in this tutorial visualizing approval and disapproval ratings of American presidents from 1941 to 2025\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/final-javascript-vertical-area-chart-scaled.png 2560w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/final-javascript-vertical-area-chart-300x187.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/final-javascript-vertical-area-chart-1024x640.png 1024w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/final-javascript-vertical-area-chart-768x480.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/final-javascript-vertical-area-chart-1536x959.png 1536w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/final-javascript-vertical-area-chart-2048x1279.png 2048w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/a><\/p>\n<h2>What Is a Vertical Area Chart?<\/h2>\n<p>A vertical area chart is a <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/\" target=\"_blank\">type of data visualization<\/a> that rotates a standard <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/area-chart\/\" target=\"_blank\">area chart<\/a> 90 degrees. The time or category axis runs vertically, and the value axis runs horizontally. The filled area between the series line and the baseline still communicates magnitude and change \u2014 the orientation just shifts so that time flows top to bottom instead of left to right.<\/p>\n<p>This layout works well in a few specific situations: when the timeline is long and a horizontal chart would compress the data too much, when category labels are long and hard to fit on a horizontal axis, or when the chart is embedded in a vertically scrolling page and a wide horizontal layout would interrupt the reading flow. It is also a natural choice when the main story is the balance between two opposing series.<\/p>\n<h2>How to Build a JavaScript Vertical Area Chart<\/h2>\n<p>Building an interactive vertical area chart with JavaScript involves four steps: creating the HTML page, loading the library, preparing the data, and writing the visualization code.<\/p>\n<h3>1. Create an HTML Page<\/h3>\n<p>Start with a minimal HTML file containing a <code>&lt;div&gt;<\/code> element that will hold the chart. The <code>#container<\/code> div is set to fill the full browser window here, but you can replace the percentage values with fixed pixel dimensions if the chart should occupy only part of a page.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n  &lt;meta charset=\"UTF-8\"&gt;\n  &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n  &lt;title&gt;JavaScript Vertical Area Chart&lt;\/title&gt;\n  &lt;style&gt;\n    \/* make the page and container fill the full browser window *\/\n    html, body, #container {\n      width: 100%;\n      height: 100%;\n      margin: 0;\n      padding: 0;\n    }\n  &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;!-- the chart will render inside this div --&gt;\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<p>Now that the HTML page is in place, let&#8217;s add the charting library.<\/p>\n<h3>2. Include the JavaScript Files<\/h3>\n<p>In this tutorial, we will be using the <a href=\"https:\/\/www.anychart.com\" target=\"_blank\">AnyChart JavaScript charting library<\/a>. The vertical area chart type is available in its <code>anychart-base.min.js<\/code> module. Load it from the AnyChart CDN by adding a <code>&lt;script&gt;<\/code> tag in the <code>&lt;head&gt;<\/code> section, then add an empty <code>&lt;script&gt;<\/code> block in the <code>&lt;body&gt;<\/code> where the chart code will go.<\/p>\n<pre><code class=\"html\">&lt;head&gt;\n  ...\n  &lt;!-- load the AnyChart base module, which includes vertical area charts --&gt;\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.14.1\/js\/anychart-base.min.js\"&gt;&lt;\/script&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\n  &lt;!-- chart code goes here --&gt;\n  &lt;script&gt;\n  &lt;\/script&gt;\n&lt;\/body&gt;<\/code><\/pre>\n<p>With the library loaded, the next step is to prepare the data.<\/p>\n<h3>3. Prepare the Data<\/h3>\n<p>The chart uses U.S. presidential job approval data from the <a href=\"https:\/\/www.presidency.ucsb.edu\/statistics\/data\/presidential-job-approval-all-data\" target=\"_blank\" rel=\"nofollow\">American Presidency Project at UC Santa Barbara<\/a>, based on Gallup polling results covering 16 presidents from Franklin D. Roosevelt to Donald Trump&#8217;s second term. Monthly averages of approval and disapproval percentages were computed across all available polls for each month.<\/p>\n<p>The dataset contains 910 monthly data points. Each row holds a month label, the average approval percentage, and the average disapproval percentage stored as a negative number. Storing disapproval as negative creates the mirrored effect around the zero baseline \u2014 the technique that gives this chart its distinctive shape. Here is a sample of the data:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<thead>\n<tr>\n<th style=\"border: 1px solid #ccc; padding: 8px 12px; text-align: center;\">Month<\/th>\n<th style=\"border: 1px solid #ccc; padding: 8px 12px; text-align: center;\">Approval (%)<\/th>\n<th style=\"border: 1px solid #ccc; padding: 8px 12px; text-align: center;\">Disapproval (stored as negative %)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">Jul 1941<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">67<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">-24<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">Jan 1953<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">68<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">-8<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">Jan 1961<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">72<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">-6<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">Oct 2001<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">88<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">-9<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">Jul 1974<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">24<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">-63<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">Jan 2009<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">56<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">-31<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">Jan 2021<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">46<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">-50<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">Dec 2025<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">36<\/td>\n<td style=\"border: 1px solid #ccc; padding: 8px 12px;\">-59<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\nEach row is a three-element array: the month label string, the approval value, and the disapproval value, and it looks like this in the code:<\/p>\n<pre><code class=\"JavaScript\">\/\/ each entry: [month label, approval %, disapproval as negative %]\n\/\/ the full dataset has 910 rows; the complete version is in the Playground link below\nconst rawData = [\n  [\"Jul 1941\", 67, -24],\n  [\"Aug 1941\", 67, -24],\n  [\"Sep 1941\", 70, -24],\n  \/\/ ... 907 more monthly entries ...\n  [\"Dec 2025\", 36, -59]\n];<\/code><\/pre>\n<h3>4. Write the JS Code for the Chart<\/h3>\n<p>All the JavaScript goes inside an <code>anychart.onDocumentReady()<\/code> wrapper \u2014 a function that AnyChart calls as soon as the page has fully loaded. This guarantees that the chart container <code>&lt;div&gt;<\/code> exists in the DOM before the chart tries to render into it.<\/p>\n<pre><code class=\"JavaScript\">anychart.onDocumentReady(function () {\n\n  \/\/ all chart code goes here\n\n});<\/code><\/pre>\n<h4>Add the Data<\/h4>\n<p class=\"p1\"><span class=\"s1\">The <\/span><span class=\"s2\">rawData<\/span><span class=\"s1\"> array from Step 3 is the first thing to place inside <code>anychart.onDocumentReady()<\/code><\/span>.<\/p>\n<p>The time axis will use a <a href=\"https:\/\/docs.anychart.com\/Axes_and_Grids\/Scales#date_time\" target=\"_blank\" rel=\"nofollow\">date\/time scale<\/a>, which requires JavaScript <code>Date<\/code> objects rather than strings like <code>\"Jul 1941\"<\/code>. Each row is therefore needs to be converted before passing it into the chart.<\/p>\n<p><code>MONTH_IDX<\/code> is a small lookup object that maps three-letter month abbreviations to their zero-based index \u2014 January = 0, December = 11 \u2014 matching the <code>Date<\/code> constructor.<\/p>\n<pre><code class=\"JavaScript\">\/\/ map month abbreviations to their zero-based JS Date index\nconst MONTH_IDX = {\n  Jan:0, Feb:1, Mar:2, Apr:3, May:4,  Jun:5,\n  Jul:6, Aug:7, Sep:8, Oct:9, Nov:10, Dec:11\n};\n\n\/\/ convert each \"MMM YYYY\" string to a Date object, keep the approval and disapproval values\nconst data = rawData.map(function(row) {\n  const parts = row[0].split(\" \");\n  return [new Date(parseInt(parts[1]), MONTH_IDX[parts[0]], 1), row[1], row[2]];\n});<\/code><\/pre>\n<h4>Create a Data Set and Map the Two Series<\/h4>\n<p>AnyChart uses a <a href=\"https:\/\/docs.anychart.com\/Working_with_Data\/Data_Sets\" target=\"_blank\" rel=\"nofollow\">data set<\/a> as a single source that can feed multiple series at once. We load all 910 rows into one with <code>anychart.data.set()<\/code>, then create two mappings from it. <code>approvalMap<\/code> reads column 1 as the series value; <code>disapprovalMap<\/code> reads column 2. Both share column 0 \u2014 the <code>Date<\/code> object \u2014 as their <code>x<\/code> position.<\/p>\n<pre><code class=\"JavaScript\">\/\/ load the data into an AnyChart data set\nconst ds = anychart.data.set(data);\n\n\/\/ map approval (column 1) and disapproval (column 2) as separate series\n\/\/ both share column 0 (the Date object) as their x position\nconst approvalMap    = ds.mapAs({x: 0, value: 1});\nconst disapprovalMap = ds.mapAs({x: 0, value: 2});<\/code><\/pre>\n<h4>Create the Chart<\/h4>\n<p>One call creates the chart. <code>anychart.verticalArea()<\/code> returns a vertical area chart instance \u2014 a standard area chart rotated 90 degrees, with the time axis running vertically and the value axis running horizontally. Everything else \u2014 series, scales, visual settings \u2014 attaches to this object.<\/p>\n<pre><code class=\"JavaScript\">\/\/ create the vertical area chart\nconst chart = anychart.verticalArea();<\/code><\/pre>\n<h4>Add the Two Area Series<\/h4>\n<p>Each series gets its own <code>chart.area()<\/code> call, bound to one of the data mappings created above. In addition, <code>connectMissingPoints(true)<\/code> keeps the line continuous across months where no poll was conducted \u2014 without it, the chart would show gaps in the data.<\/p>\n<pre><code class=\"JavaScript\">\/\/ approval series: positive values extend to the right of the zero line\nconst approvalSeries = chart.area(approvalMap);\napprovalSeries.name(\"Approval\");\napprovalSeries.connectMissingPoints(true); \/\/ bridge months with no poll data\n\n\/\/ disapproval series: negative values extend to the left of the zero line\nconst disapprovalSeries = chart.area(disapprovalMap);\ndisapprovalSeries.name(\"Disapproval\");\ndisapprovalSeries.connectMissingPoints(true);<\/code><\/pre>\n<h4>Configure the Scales<\/h4>\n<p>The chart has two <a href=\"https:\/\/docs.anychart.com\/Axes_and_Grids\/Scales\" target=\"_blank\" rel=\"nofollow\">scales<\/a> to configure: the x-scale for the vertical time axis and the y-scale for the horizontal value axis.<\/p>\n<p>The default x-scale places ticks at data-point positions, which is not useful here. We replace it with a date\/time scale that puts one tick at the start of every calendar year. <code>inverted(true)<\/code> flips the direction: 1941 at the top, 2025 at the bottom \u2014 the natural reading order for a historical timeline.<\/p>\n<pre><code class=\"JavaScript\">\/\/ replace the default scale with a datetime scale for proper yearly tick marks\nconst xScale = anychart.scales.dateTime();\nxScale.ticks().interval(\"year\", 1); \/\/ one tick at the start of every calendar year\nxScale.inverted(true);              \/\/ 1941 at top, 2025 at bottom\nchart.xScale(xScale);<\/code><\/pre>\n<p>For the y-scale, we fix the range at \u2212100 to 100. This keeps both sides symmetrical and prevents clipping even the most extreme values in the dataset.<\/p>\n<pre><code class=\"JavaScript\">\/\/ set the horizontal value axis to run symmetrically from -100 to 100\nchart.yScale().minimum(-100);\nchart.yScale().maximum(100);<\/code><\/pre>\n<h4>Final Steps<\/h4>\n<p>A few more calls finish the setup before rendering.<\/p>\n<p>First, <code>chart.title()<\/code> sets a descriptive <a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Title\" target=\"_blank\" rel=\"nofollow\">title<\/a> above the chart.<\/p>\n<pre><code class=\"JavaScript\">\/\/ add a descriptive title above the chart\nchart.title(\"U.S. Presidential Approval Ratings (1941\u20132025)\");<\/code><\/pre>\n<p>Second, <code>chart.legend(true)<\/code> enables the <a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Legend\/Overview\" target=\"_blank\" rel=\"nofollow\">legend<\/a> so the viewer knows which color is approval and which is disapproval.<\/p>\n<pre><code class=\"JavaScript\">\/\/ show the series legend\nchart.legend(true);<\/code><\/pre>\n<p>Finally, <code>chart.container()<\/code> names the <code>&lt;div&gt;<\/code> the chart should render into, and <code>chart.draw()<\/code> triggers the render because nothing appears on the page until this call runs.<\/p>\n<pre><code class=\"JavaScript\">\/\/ point the chart at the container div and render it\nchart.container(\"container\");\nchart.draw();<\/code><\/pre>\n<h3>Full Code and Result<\/h3>\n<p>Here is the complete, runnable HTML code with all the pieces assembled. The data array is abbreviated below \u2014 the full 910-row dataset is available in the Playground link below.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n  &lt;meta charset=\"UTF-8\"&gt;\n  &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n  &lt;title&gt;JavaScript Vertical Area Chart&lt;\/title&gt;\n  &lt;style&gt;\n    html, body, #container {\n      width: 100%;\n      height: 100%;\n      margin: 0;\n      padding: 0;\n    }\n  &lt;\/style&gt;\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.14.1\/js\/anychart-base.min.js\"&gt;&lt;\/script&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\n  &lt;script&gt;\n    anychart.onDocumentReady(function () {\n      \/\/ monthly approval\/disapproval data, 1941\u20132025\n      \/\/ source: American Presidency Project, UC Santa Barbara\n      const rawData = [\n        [\"Jul 1941\", 67, -24],\n        \/\/ ... full dataset in the Playground link below\n        [\"Dec 2025\", 36, -59]\n      ];\n      \/\/ convert \"MMM YYYY\" labels to Date objects for the datetime scale\n      const MONTH_IDX = {\n        Jan:0, Feb:1, Mar:2, Apr:3, May:4,  Jun:5,\n        Jul:6, Aug:7, Sep:8, Oct:9, Nov:10, Dec:11\n      };\n      const data = rawData.map(function(row) {\n        const parts = row[0].split(\" \");\n        return [new Date(parseInt(parts[1]), MONTH_IDX[parts[0]], 1), row[1], row[2]];\n      });\n      \/\/ load into a data set and create two series mappings\n      const ds = anychart.data.set(data);\n      const approvalMap    = ds.mapAs({x: 0, value: 1});\n      const disapprovalMap = ds.mapAs({x: 0, value: 2});\n      \/\/ create a vertical area chart\n      const chart = anychart.verticalArea();\n      \/\/ approval and disapproval area series\n      const approvalSeries = chart.area(approvalMap);\n      approvalSeries.name(\"Approval\");\n      approvalSeries.connectMissingPoints(true);\n      const disapprovalSeries = chart.area(disapprovalMap);\n      disapprovalSeries.name(\"Disapproval\");\n      disapprovalSeries.connectMissingPoints(true);\n      \/\/ datetime x-scale: yearly ticks, oldest at top\n      const xScale = anychart.scales.dateTime();\n      xScale.ticks().interval(\"year\", 1);\n      xScale.inverted(true);\n      chart.xScale(xScale);\n      \/\/ y-scale: symmetrical range around zero\n      chart.yScale().minimum(-100);\n      chart.yScale().maximum(100);\n      \/\/ title, legend, and render\n      chart.title(\"U.S. Presidential Approval Ratings (1941\u20132025)\");\n      chart.legend(true);\n      chart.container(\"container\");\n      chart.draw();\n    });\n  &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<p>That&#8217;s it! A basic JavaScript vertical area chart is ready, showing U.S. presidential approval and disapproval ratings since 1941 according to Gallup. Take a look at it below or open it on <a href=\"https:\/\/playground.anychart.com\/YqAgYRcr\" target=\"_blank\" rel=\"nofollow\">AnyChart Playground<\/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-YqAgYRcr\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/YqAgYRcr\/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-YqAgYRcr{width:100%;height:700px;}\");\n})();<\/script><\/p>\n<h2>How to Customize a JavaScript Vertical Area Chart<\/h2>\n<p>Now let&#8217;s make some changes to the chart&#8217;s design and behavior. The five customizations below improve readability and add contextual information to the vertical area chart built in the previous part of the tutorial.<\/p>\n<h3>A. Smooth the Curves with Spline Area<\/h3>\n<p>The plain <code>area()<\/code> series connects data points with straight line segments, producing a jagged silhouette. Switching to <code>splineArea()<\/code> fits a smooth curve through the same points. Over 910 monthly values, the smoothed version reveals the broad trends without visual noise from minor month-to-month fluctuations.<\/p>\n<p>Replace <code>chart.area()<\/code> with <code>chart.splineArea()<\/code> for both series:<\/p>\n<pre><code class=\"JavaScript\">\/\/ splineArea draws smooth interpolated curves instead of angular segments\nconst approvalSeries    = chart.splineArea(approvalMap);\nconst disapprovalSeries = chart.splineArea(disapprovalMap);<\/code><\/pre>\n<h3>B. Set Series Colors<\/h3>\n<p>Green and red carry an intuitive meaning for approval and disapproval data. Use the <code>fill()<\/code> method to set the area color and opacity, and <code>stroke()<\/code> to set the outline color and thickness.<\/p>\n<pre><code class=\"JavaScript\">\/\/ green fill and outline for the approval series\napprovalSeries.normal().fill(\"#27ae60\", 0.5);\napprovalSeries.normal().stroke(\"#27ae60\", 1.5);\n\n\/\/ red fill and outline for the disapproval series\ndisapprovalSeries.normal().fill(\"#e74c3c\", 0.5);\ndisapprovalSeries.normal().stroke(\"#e74c3c\", 1.5);<\/code><\/pre>\n<h3>C. Format the Value Axis<\/h3>\n<p>Disapproval values are stored as negative numbers, so the horizontal axis would normally label the left side &#8220;-75&#8221;, &#8220;-50&#8221;, and so on. Displaying both sides as absolute values \u2014 &#8220;75%&#8221;, &#8220;50%&#8221; \u2014 makes the chart symmetrical and easier to read. The <code>Math.abs()<\/code> function in the label <code>format()<\/code> callback handles the conversion. While here, grid lines at every 25 percentage points and an explanatory axis title add further clarity.<\/p>\n<pre><code class=\"JavaScript\">\/\/ display absolute values with % sign on both sides of the axis\nchart.yAxis().labels().format(function() {\n  return Math.abs(this.value) + \"%\";\n});\n\n\/\/ label the axis to indicate which direction means approval and which means disapproval\nchart.yAxis().title(\"\u2190 Disapproval  |  Approval \u2192\");\n\n\/\/ add vertical grid lines at \u00b125, \u00b150, \u00b175, and 0\nchart.yScale().ticks().interval(25);\nchart.yGrid(true);\nchart.yGrid().stroke({color: \"#dddddd\", thickness: 0.5});<\/code><\/pre>\n<h3>D. Highlight the Zero Baseline<\/h3>\n<p>The zero line \u2014 where approval equals disapproval \u2014 is the most important reference point in the chart. A <code>lineMarker<\/code> at value 0 draws a prominent vertical line across the plot, making the boundary between net-positive and net-negative approval immediately visible.<\/p>\n<pre><code class=\"JavaScript\">\/\/ draw a distinct line at zero \u2014 the boundary between net approval and net disapproval\nconst zeroLine = chart.lineMarker(0);\nzeroLine.value(0);\nzeroLine.stroke({color: \"#444444\", thickness: 2});<\/code><\/pre>\n<h3>E. Add a Contextual Tooltip<\/h3>\n<p>By default, the <a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Tooltip\" target=\"_blank\" rel=\"nofollow\">tooltip<\/a> shows the raw timestamp and series value. We can make it more informative by displaying the president&#8217;s name and party in the title, the calendar month in the body, and the correct percentage label for each series. This can be done through a lookup table with a function to work with it, followed by the tooltip configuration itself.<\/p>\n<h4>Build the President Lookup Table and Function<\/h4>\n<p>The lookup table is an array of objects, one per president, each holding the name, party abbreviation, and the start and end dates of their term. JavaScript <code>Date<\/code> objects use zero-based month numbers, so January = 0, April = 3, August = 7, and so on.<\/p>\n<pre><code class=\"JavaScript\">\/\/ each entry: president name, party, and term start and end as Date objects\nconst presidents = [\n  {name: \"Franklin D. Roosevelt\", party: \"D\", from: new Date(1941,6,1), to: new Date(1945,3,1)},\n  {name: \"Harry S. Truman\",       party: \"D\", from: new Date(1945,3,1), to: new Date(1953,0,1)},\n  {name: \"Dwight D. Eisenhower\",  party: \"R\", from: new Date(1953,0,1), to: new Date(1961,0,1)},\n  {name: \"John F. Kennedy\",       party: \"D\", from: new Date(1961,0,1), to: new Date(1963,10,1)},\n  {name: \"Lyndon B. Johnson\",     party: \"D\", from: new Date(1963,10,1),to: new Date(1969,0,1)},\n  {name: \"Richard Nixon\",         party: \"R\", from: new Date(1969,0,1), to: new Date(1974,7,1)},\n  {name: \"Gerald Ford\",           party: \"R\", from: new Date(1974,7,1), to: new Date(1977,0,1)},\n  {name: \"Jimmy Carter\",          party: \"D\", from: new Date(1977,0,1), to: new Date(1981,0,1)},\n  {name: \"Ronald Reagan\",         party: \"R\", from: new Date(1981,0,1), to: new Date(1989,0,1)},\n  {name: \"George H.W. Bush\",      party: \"R\", from: new Date(1989,0,1), to: new Date(1993,0,1)},\n  {name: \"Bill Clinton\",          party: \"D\", from: new Date(1993,0,1), to: new Date(2001,0,1)},\n  {name: \"George W. Bush\",        party: \"R\", from: new Date(2001,0,1), to: new Date(2009,0,1)},\n  {name: \"Barack Obama\",          party: \"D\", from: new Date(2009,0,1), to: new Date(2017,0,1)},\n  {name: \"Donald Trump\",          party: \"R\", from: new Date(2017,0,1), to: new Date(2021,0,1)},\n  {name: \"Joe Biden\",             party: \"D\", from: new Date(2021,0,1), to: new Date(2025,0,1)},\n  {name: \"Donald Trump\",          party: \"R\", from: new Date(2025,0,1), to: new Date(2029,0,1)}\n];<\/code><\/pre>\n<p>Finding the president in office on any given date requires a function that searches the lookup table by date range. <code>getPresident()<\/code> takes a timestamp, walks through the table, and returns the matching president object. If no entry covers the date, it returns <code>null<\/code>.<\/p>\n<pre><code class=\"JavaScript\">\/\/ find the president in office on a given date (passed as a timestamp)\nfunction getPresident(ts) {\n  const d = new Date(ts);\n  for (const p of presidents) {\n    if (d &gt;= p.from &amp;&amp; d &lt; p.to) return p;\n  }\n  return null;\n}<\/code><\/pre>\n<h4>Configure the Tooltip<\/h4>\n<p>Two settings merge the series data and enable HTML formatting. <code>displayMode(\"union\")<\/code> displays both series in a single tooltip, so the viewer sees approval and disapproval for the same month side by side. <code>useHtml(true)<\/code> enables HTML markup in the tooltip body, which lets us use <code>&lt;br\/&gt;<\/code> to put values on separate lines.<\/p>\n<pre><code class=\"JavaScript\">\/\/ merge both series into one tooltip and allow HTML inside it\nchart.tooltip().displayMode(\"union\");\nchart.tooltip().useHtml(true);<\/code><\/pre>\n<p>The tooltip title should name the president in office at the hovered date. <code>titleFormat<\/code> is a callback that runs once per hovered point and returns this tooltip title string. Inside it, <code>this.x<\/code> holds the timestamp of the hovered month \u2014 passed directly to <code>getPresident()<\/code> to retrieve the president&#8217;s name and party.<\/p>\n<pre><code class=\"JavaScript\">\/\/ tooltip title: look up the president in office on the hovered date\nchart.tooltip().titleFormat(function() {\n  const p = getPresident(this.x);\n  return p ? (p.name + \" (\" + p.party + \")\") : \"\";\n});<\/code><\/pre>\n<p>The tooltip body should show the calendar month and the series value. <code>format<\/code> runs once per series and returns that series&#8217; line in the tooltip body. A short month-name array rebuilds the date label from the timestamp. For the disapproval series, <code>Math.abs()<\/code> converts the stored negative value back to a readable positive percentage.<\/p>\n<pre><code class=\"JavaScript\">\/\/ month name array for formatting the date label in the tooltip body\nconst MON = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];\n\n\/\/ tooltip body: show the month, then the value for each series\nchart.tooltip().format(function() {\n  const d = new Date(this.x);\n  const label = MON[d.getMonth()] + \" \" + d.getFullYear();\n  if (this.seriesName === \"Approval\") {\n    return label + \"&lt;br\/&gt;Approval: \" + this.value + \"%\";\n  }\n  return \"Disapproval: \" + Math.abs(this.value) + \"%\";\n});<\/code><\/pre>\n<h3>Final Result<\/h3>\n<p>Below is the complete interactive vertical area chart with all customizations applied \u2014 smoothed curves, custom colors, formatted axis, zero baseline, and a contextual tooltip showing the president in office for any hovered month. Feel free to explore the full code and play with it further on <a href=\"https:\/\/playground.anychart.com\/jIH6T1XH\" target=\"_blank\" rel=\"nofollow\">AnyChart Playground<\/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-jIH6T1XH\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/jIH6T1XH\/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-jIH6T1XH{width:100%;height:700px;}\");\n})();<\/script><\/p>\n<h2>Conclusion<\/h2>\n<p>This tutorial covered building an interactive <strong>JavaScript vertical area chart<\/strong> that maps more than eight decades of public opinion data in a single view. The vertical orientation, mirrored series, and contextual tooltip make it easy to compare how approval and disapproval moved together across U.S. administrations.<\/p>\n<p>Browse the gallery for more <a href=\"https:\/\/www.anychart.com\/products\/anychart\/gallery\/Vertical_Charts\" target=\"_blank\">vertical chart examples<\/a>. To build a horizontal area chart, see the <a href=\"https:\/\/www.anychart.com\/blog\/2020\/05\/07\/area-chart-js-tutorial\/\">area chart tutorial<\/a>. Beyond that, explore other <a href=\"https:\/\/www.anychart.com\/blog\/category\/javascript-chart-tutorials\/\">JavaScript charting tutorials<\/a>, the <a href=\"https:\/\/docs.anychart.com\/Quick_Start\/Supported_Charts_Types\" target=\"_blank\" rel=\"nofollow\">supported chart types<\/a>, the <a href=\"https:\/\/docs.anychart.com\" target=\"_blank\" rel=\"nofollow\">documentation<\/a>, and the <a href=\"https:\/\/api.anychart.com\" target=\"_blank\" rel=\"nofollow\">API reference<\/a>.<\/p>\n<p>Questions? Ask in the comments or contact the <a href=\"https:\/\/www.anychart.com\/support\/\" target=\"_blank\">Support Team<\/a>.<\/p>\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>Traditionally, charts that visualize data over time are horizontal. But sometimes a vertical layout is a better fit. In this tutorial, you will learn how to create an interactive vertical area chart using JavaScript step by step. The practical example uses monthly approval and disapproval ratings of American presidents from 1941 to 2025, according to [&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":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,263,23,13,279,4],"tags":[3663,4495,53,3935,4492,72,73,3211,1455,4517,1758,3149,284,127,166,258,471,266,620,1759,3352,509,291,195,4253,2220,54,1389,256,1111,744,3032,1379,165,313,1370,133,774,775,4488,3369,4493,4501,567,4515,1498,4511,805,4491,4496,870,1457,4513,4509,95,868,4498,2013,2014,32,55,167,146,433,151,36,907,141,249,81,57,1238,142,96,99,134,4514,1786,4510,58,65,56,4512,4506,1190,4503,4504,4507,4497,4500,423,2355,2354,4499,4516,869,4489,459,4505,2844,30,3367,172,309,4508,4502,4494,4490,4246,954,293,2015,2816,1763,804],"class_list":["post-20439","post","type-post","status-publish","format-standard","hentry","category-anychart-charting-component","category-big-data","category-html5","category-javascript","category-javascript-chart-tutorials","category-tips-and-tricks","tag-american-presidency-project","tag-american-presidents","tag-anychart","tag-anychart-tutorial","tag-approval-ratings","tag-area-chart","tag-area-charts","tag-area-graph","tag-barack-obama","tag-bill-clinton","tag-chart-design","tag-chart-development","tag-chart-examples","tag-chart-types","tag-charting","tag-charts","tag-data-analysis","tag-data-analytics","tag-data-analytics-examples","tag-data-design","tag-data-graphic","tag-data-graphics","tag-data-journalism","tag-data-over-time","tag-data-storytelling","tag-data-visual","tag-data-visualization","tag-data-visualization-best-pracices","tag-data-visualization-examples","tag-data-visualization-practice","tag-data-visualization-techniques","tag-data-visualization-technologies","tag-data-visualization-tool","tag-data-visualizations","tag-data-visuals","tag-data-viz-examples","tag-dataviz","tag-dataviz-examples","tag-dataviz-projects","tag-datetime-scale","tag-developers","tag-disapproval-ratings","tag-diverging-chart","tag-donald-trump","tag-dwight-eisenhower","tag-example","tag-franklin-roosevelt","tag-front-end-development","tag-gallup","tag-gallup-poll","tag-george-bush","tag-george-w-bush","tag-gerald-ford","tag-government-data","tag-graphics-library","tag-harry-truman","tag-historical-data","tag-html","tag-html-charts","tag-html5","tag-html5-charts","tag-interactive-charts","tag-interactive-data-visualization","tag-interactive-graphics","tag-interactive-visualizations","tag-javascript","tag-javascript-chart-tutorial","tag-javascript-charting","tag-javascript-charting-api","tag-javascript-charting-library","tag-javascript-charts","tag-javascript-graph","tag-javascript-graphics","tag-javascript-graphics-library","tag-javascript-library","tag-javascript-technologies","tag-jimmy-carter","tag-joe-biden","tag-john-kennedy","tag-js-chart","tag-js-charting","tag-js-charts","tag-lyndon-johnson","tag-mirrored-chart","tag-open-data","tag-political-data","tag-political-data-visualization","tag-political-history","tag-political-visualization","tag-poll-data","tag-polling-data","tag-presidential-approval-ratings","tag-public-opinion","tag-public-opinion-polls","tag-richard-nixon","tag-ronald-reagan","tag-spline-area-chart","tag-statistics","tag-time-series-visualization","tag-time-series-chart","tag-tips-and-tricks","tag-tuto","tag-tutorial","tag-united-states","tag-us-history","tag-us-politics","tag-us-presidents","tag-vertical-area-chart","tag-vertical-chart","tag-visual-data-analytics","tag-visualization","tag-web-charts","tag-web-design","tag-web-developers","tag-web-development","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create a JavaScript Vertical Area Chart<\/title>\n<meta name=\"description\" content=\"Learn how to create an interactive vertical area chart using JavaScript step by step, visualizing Gallup data on ratings of U.S. presidents.\" \/>\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\/2026\/04\/09\/javascript-vertical-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 a Vertical Area Chart with JavaScript\" \/>\n<meta property=\"og:description\" content=\"Visualizing U.S. presidents&#039; ratings over 80+ years, learn how to create an interactive JavaScript vertical area chart step by step.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-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=\"2026-04-09T00:59:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-10T09:55:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/vertical-area-chart-javascript-us-president-ratings-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Taylor Brooks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Create a Vertical Area Chart with JavaScript\" \/>\n<meta name=\"twitter:description\" content=\"Visualizing U.S. presidents&#039; ratings over 80+ years, learn how to create an interactive JavaScript vertical area chart step by step.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/vertical-area-chart-javascript-us-president-ratings-x.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=\"Taylor Brooks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/\"},\"author\":{\"name\":\"Taylor Brooks\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8\"},\"headline\":\"How to Create a JavaScript Vertical Area Chart\",\"datePublished\":\"2026-04-09T00:59:00+00:00\",\"dateModified\":\"2026-04-10T09:55:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/\"},\"wordCount\":1714,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png\",\"keywords\":[\"American Presidency Project\",\"American presidents\",\"AnyChart\",\"AnyChart tutorial\",\"approval ratings\",\"area chart\",\"area charts\",\"area graph\",\"Barack Obama\",\"Bill Clinton\",\"chart design\",\"chart development\",\"chart examples\",\"chart types\",\"charting\",\"charts\",\"data analysis\",\"data analytics\",\"data analytics examples\",\"data design\",\"data graphic\",\"data graphics\",\"data journalism\",\"data over time\",\"Data Storytelling\",\"data visual\",\"Data Visualization\",\"data visualization best practices\",\"data visualization examples\",\"data visualization practice\",\"data visualization techniques\",\"data visualization technologies\",\"data visualization tool\",\"data visualizations\",\"data visuals\",\"data viz examples\",\"dataviz\",\"dataviz examples\",\"dataviz projects\",\"datetime scale\",\"developers\",\"disapproval ratings\",\"diverging chart\",\"Donald Trump\",\"Dwight Eisenhower\",\"example\",\"Franklin Roosevelt\",\"front-end development\",\"Gallup\",\"Gallup poll\",\"George Bush\",\"George W. Bush\",\"Gerald Ford\",\"government data\",\"graphics library\",\"Harry Truman\",\"historical data\",\"HTML\",\"HTML charts\",\"HTML5\",\"html5 charts\",\"interactive charts\",\"interactive data visualization\",\"interactive graphics\",\"interactive visualizations\",\"JavaScript\",\"javascript chart tutorial\",\"javascript charting\",\"javascript charting api\",\"JavaScript charting library\",\"javascript charts\",\"javascript graph\",\"javascript graphics\",\"JavaScript graphics library\",\"JavaScript library\",\"javascript technologies\",\"Jimmy Carter\",\"Joe Biden\",\"John Kennedy\",\"js chart\",\"js charting\",\"js charts\",\"Lyndon Johnson\",\"mirrored chart\",\"open data\",\"political data\",\"political data visualization\",\"political history\",\"political visualization\",\"poll data\",\"polling data\",\"presidential approval ratings\",\"public opinion\",\"public opinion polls\",\"Richard Nixon\",\"Ronald Reagan\",\"spline area chart\",\"statistics\",\"time series visualization\",\"time-series-chart\",\"Tips and tricks\",\"tuto\",\"tutorial\",\"united states\",\"US history\",\"US politics\",\"US presidents\",\"vertical area chart\",\"vertical chart\",\"visual data analytics\",\"visualization\",\"web charts\",\"web design\",\"web developers\",\"web development\"],\"articleSection\":[\"AnyChart Charting Component\",\"Big Data\",\"HTML5\",\"JavaScript\",\"JavaScript Chart Tutorials\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/\",\"name\":\"How to Create a JavaScript Vertical Area Chart\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png\",\"datePublished\":\"2026-04-09T00:59:00+00:00\",\"dateModified\":\"2026-04-10T09:55:15+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8\"},\"description\":\"Learn how to create an interactive vertical area chart using JavaScript step by step, visualizing Gallup data on ratings of U.S. presidents.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#primaryimage\",\"url\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png\",\"contentUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png\",\"width\":1536,\"height\":980},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create a JavaScript Vertical 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\/f86e4e643008eb1a114a0aa8335a6fc8\",\"name\":\"Taylor Brooks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fd77405633821cef0929db330d381c1109d9a1a17560196ad7c2ed0e8349234b?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fd77405633821cef0929db330d381c1109d9a1a17560196ad7c2ed0e8349234b?s=96&r=g\",\"caption\":\"Taylor Brooks\"},\"url\":\"https:\/\/www.anychart.com\/blog\/author\/tbrooks\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a JavaScript Vertical Area Chart","description":"Learn how to create an interactive vertical area chart using JavaScript step by step, visualizing Gallup data on ratings of U.S. presidents.","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\/2026\/04\/09\/javascript-vertical-area-chart\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a Vertical Area Chart with JavaScript","og_description":"Visualizing U.S. presidents' ratings over 80+ years, learn how to create an interactive JavaScript vertical area chart step by step.","og_url":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2026-04-09T00:59:00+00:00","article_modified_time":"2026-04-10T09:55:15+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/vertical-area-chart-javascript-us-president-ratings-og.png","type":"image\/png"}],"author":"Taylor Brooks","twitter_card":"summary_large_image","twitter_title":"How to Create a Vertical Area Chart with JavaScript","twitter_description":"Visualizing U.S. presidents' ratings over 80+ years, learn how to create an interactive JavaScript vertical area chart step by step.","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/vertical-area-chart-javascript-us-president-ratings-x.png","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Taylor Brooks","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/"},"author":{"name":"Taylor Brooks","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8"},"headline":"How to Create a JavaScript Vertical Area Chart","datePublished":"2026-04-09T00:59:00+00:00","dateModified":"2026-04-10T09:55:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/"},"wordCount":1714,"commentCount":0,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png","keywords":["American Presidency Project","American presidents","AnyChart","AnyChart tutorial","approval ratings","area chart","area charts","area graph","Barack Obama","Bill Clinton","chart design","chart development","chart examples","chart types","charting","charts","data analysis","data analytics","data analytics examples","data design","data graphic","data graphics","data journalism","data over time","Data Storytelling","data visual","Data Visualization","data visualization best practices","data visualization examples","data visualization practice","data visualization techniques","data visualization technologies","data visualization tool","data visualizations","data visuals","data viz examples","dataviz","dataviz examples","dataviz projects","datetime scale","developers","disapproval ratings","diverging chart","Donald Trump","Dwight Eisenhower","example","Franklin Roosevelt","front-end development","Gallup","Gallup poll","George Bush","George W. Bush","Gerald Ford","government data","graphics library","Harry Truman","historical data","HTML","HTML charts","HTML5","html5 charts","interactive charts","interactive data visualization","interactive graphics","interactive visualizations","JavaScript","javascript chart tutorial","javascript charting","javascript charting api","JavaScript charting library","javascript charts","javascript graph","javascript graphics","JavaScript graphics library","JavaScript library","javascript technologies","Jimmy Carter","Joe Biden","John Kennedy","js chart","js charting","js charts","Lyndon Johnson","mirrored chart","open data","political data","political data visualization","political history","political visualization","poll data","polling data","presidential approval ratings","public opinion","public opinion polls","Richard Nixon","Ronald Reagan","spline area chart","statistics","time series visualization","time-series-chart","Tips and tricks","tuto","tutorial","united states","US history","US politics","US presidents","vertical area chart","vertical chart","visual data analytics","visualization","web charts","web design","web developers","web development"],"articleSection":["AnyChart Charting Component","Big Data","HTML5","JavaScript","JavaScript Chart Tutorials","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/","url":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/","name":"How to Create a JavaScript Vertical Area Chart","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png","datePublished":"2026-04-09T00:59:00+00:00","dateModified":"2026-04-10T09:55:15+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8"},"description":"Learn how to create an interactive vertical area chart using JavaScript step by step, visualizing Gallup data on ratings of U.S. presidents.","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#primaryimage","url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png","contentUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2026\/04\/javascript-vertical-area-chart-us-president-ratings.png","width":1536,"height":980},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2026\/04\/09\/javascript-vertical-area-chart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create a JavaScript Vertical 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\/f86e4e643008eb1a114a0aa8335a6fc8","name":"Taylor Brooks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fd77405633821cef0929db330d381c1109d9a1a17560196ad7c2ed0e8349234b?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fd77405633821cef0929db330d381c1109d9a1a17560196ad7c2ed0e8349234b?s=96&r=g","caption":"Taylor Brooks"},"url":"https:\/\/www.anychart.com\/blog\/author\/tbrooks\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/20439","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\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=20439"}],"version-history":[{"count":53,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/20439\/revisions"}],"predecessor-version":[{"id":20555,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/20439\/revisions\/20555"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=20439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=20439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=20439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}