{"id":13821,"date":"2021-10-20T09:48:37","date_gmt":"2021-10-20T09:48:37","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=13821"},"modified":"2022-08-13T11:09:12","modified_gmt":"2022-08-13T11:09:12","slug":"linear-gauge-chart-javascript","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/","title":{"rendered":"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial"},"content":{"rendered":"<p><a href=\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/\"><img decoding=\"async\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png\" alt=\"A laptop showing an interactive Linear Gauge Chart explained and created in JavaScript along this data visualization tutorial\" width=\"100%\" class=\"alignnone size-full wp-image-13834\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png 1600w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5-300x158.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5-768x403.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5-1024x538.png 1024w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><\/a><span style=\"font-size: large;\"><strong><em>This article presents an easy-to-follow guide for building an interactive linear gauge chart in JavaScript.<\/em><\/strong><\/span><\/p>\n<p>We\u2019ll show how to quickly create a cool and interactive linear gauge chart that highlights Covid-19 vaccination data around the world. Our chart will allow us to visualize the status of Covid-19 vaccination at the time of writing, and will display two types of data \u2014 showing how far away we are from the halfway target of both partially and fully vaccinating the global population.<\/p>\n<p><!--more Read the JS charting tutorial \u00bb--><\/p>\n<h2>What Is a Linear Gauge Chart?<\/h2>\n<p><a href=\"https:\/\/www.anychart.com\/blog\/2018\/11\/20\/data-visualization-definition-history-examples\/\">Data visualization<\/a> is an invaluable tool, given the vast amount of data being created and numerous possibilities for gleaning information from data. Data visualization is particularly useful for identifying trends, interpreting patterns, and communicating complex ideas to the target audience.<\/p>\n<p>A <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/linear-gauge\/\">linear gauge<\/a> chart represents a vertical or horizontal linear scale that shows the required values, with a color scale along with single or multiple pointers. The minimum and maximum values of the data range can be set over the axes according to the data being represented. The pointer position indicates the current value of the metric.<\/p>\n<p>A gauge chart can display a single value or multiple values using an individual pointer or a combination of markers. The pointer can be a needle or a line with a marker of any shape like a circle, square, rectangle or triangle.<\/p>\n<p>The linear gauge chart type is an effective visual representation for displaying how close or far the values are from the desired data point.<\/p>\n<h3>Types of linear gauges<\/h3>\n<p>The several types of linear gauges are thermometer chart, bullet chart, tank chart and LED chart. The mercury thermometer \u2014 consisting of minor ticks that displays the temperature with the pointer value \u2014 is a classic example of a linear gauge chart.<\/p>\n<h3>The linear gauge visualization we\u2019ll be building<\/h3>\n<p>Here\u2019s a sneak peek at the final linear gauge chart. Follow this tutorial to learn how we build this interesting and informative linear gauge chart with JavaScript.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/js-linear-gauge-chart-preview.png\" alt=\"Final JS linear gauge chart preview\" width=\"100%\" class=\"alignnone size-full wp-image-13837\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/js-linear-gauge-chart-preview.png 1200w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/js-linear-gauge-chart-preview-300x173.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/js-linear-gauge-chart-preview-768x442.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/js-linear-gauge-chart-preview-1024x589.png 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<h2>The Four Steps to Building a JavaScript Linear Gauge<\/h3>\n<p>It\u2019s always useful to have some skills with technologies like HTML and JavaScript. But in this tutorial, we\u2019re using a JS charting library that makes it easier to create compelling charts like the linear gauge even with minimal technical knowledge.<\/p>\n<p>There are several <a href=\"https:\/\/en.wikipedia.org\/wiki\/Comparison_of_JavaScript_charting_libraries\" target=\"_blank\" rel=\"nofollow\">JavaScript charting libraries<\/a> for visualizing data with ease, and here we\u2019re creating the linear gauge chart with <a href=\"https:\/\/www.anychart.com\/\">AnyChart<\/a>. This library is flexible, with <a href=\"https:\/\/docs.anychart.com\/\" target=\"_blank\" rel=\"nofollow\">extensive documentation<\/a>, and it consists some <a href=\"https:\/\/www.anychart.com\/products\/anychart\/gallery\/\">great examples<\/a>. Moreover, it has a <a href=\"https:\/\/playground.anychart.com\/\" target=\"_blank\" rel=\"nofollow\">playground<\/a> for experimenting with code and is free for non-commercial use. If you want to buy a licensed version, you can check out the <a href=\"https:\/\/www.anychart.com\/buy\/\">available options<\/a>, and if you\u2019re an educational or not-for-profit organization, you can get in touch for a free license <a href=\"https:\/\/www.anychart.com\/buy\/non-commercial-license\/\">here<\/a>.<\/p>\n<h3>The Steps for Making a JavaScript Linear Gauge<\/h2>\n<p>These are the basic steps for creating a linear gauge chart:<\/p>\n<ol>\n<li>Create a basic HTML page.<\/li>\n<li>Include the necessary JavaScript files.<\/li>\n<li>Add the data.<\/li>\n<li>Write the JavaScript code for the chart.<\/li>\n<\/ol>\n<p>Let\u2019s look through each of these steps in detail below.<\/p>\n<h3>1. Create a basic HTML page<\/h3>\n<p>The first thing we need to do is make an HTML page that will hold our visualization. We add a <code>&lt;div&gt;<\/code> block element and give it an ID so we can reference it later:<\/p>\n<pre><code class=\"html\">&lt;html lang=\"en\"&gt;\r\n&nbsp;&nbsp;&lt;head&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;JavaScript Linear Gauge&lt;\/title&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;style type=\"text\/css\"&gt;      \r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;html, body, #container { \r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width: 100%; height: 100%; margin: 0; padding: 0; \r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} \r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/style&gt;\r\n&nbsp;&nbsp;&lt;\/head&gt;\r\n&nbsp;&nbsp;&lt;body&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n&nbsp;&nbsp;&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<p>The width and height attributes of the <code>&lt;div&gt;<\/code> are set to 100% so that the chart is rendered across the entire screen. These attributes can be modified according to requirements.<\/p>\n<h3>2. Include the necessary JavaScript files<\/h3>\n<p>The next step is to reference the JS links in the HTML page. We\u2019ll use the AnyChart library for this tutorial, so let\u2019s include the corresponding files from their <a href=\"https:\/\/cdn.anychart.com\/\" target=\"_blank\" rel=\"nofollow\">CDN<\/a>.<\/p>\n<p>To create a linear gauge chart, we\u2019ll need to add three scripts: the <a href=\"https:\/\/docs.anychart.com\/Quick_Start\/Modules#core\" target=\"_blank\" rel=\"nofollow\">core module<\/a>, the <a href=\"https:\/\/docs.anychart.com\/Quick_Start\/Modules#linear_gauge\" target=\"_blank\" rel=\"nofollow\">linear gauge module<\/a>, and the <a href=\"https:\/\/docs.anychart.com\/Quick_Start\/Modules#table_ui\" target=\"_blank\" rel=\"nofollow\">table module<\/a>:<\/p>\n<pre><code class=\"html\">&lt;html lang=\"en\"&gt;\r\n&nbsp;&nbsp;&lt;head&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;JavaScript Linear Gauge&lt;\/title&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;style type=\"text\/css\"&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;html, body, #container { \r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width: 100%; height: 100%; margin: 0; padding: 0; \r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} \r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/style&gt;\r\n&nbsp;&nbsp;&lt;\/head&gt;\r\n&nbsp;&nbsp;&lt;body&gt;  \r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;script&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ All the code for the JS linear gauge will come here\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/script&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.10.0\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.10.0\/js\/anychart-linear-gauge.min.js\"&gt;&lt;\/script&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.10.0\/js\/anychart-table.min.js\"&gt;&lt;\/script&gt;\r\n&nbsp;&nbsp;&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h3>3. Add the data values<\/h3>\n<p>The data for the linear gauge chart is collected from <a href=\"https:\/\/ourworldindata.org\/\" target=\"_blank\" rel=\"nofollow\">Our World in Data<\/a> and included in the code. On that site, we can see the percentage of the people having received one and two Covid <a href=\"https:\/\/ourworldindata.org\/covid-vaccinations\" target=\"_blank\" rel=\"nofollow\">vaccine doses<\/a> for each continent in the whole world.<\/p>\n<p>Because (at the time of writing) none of the numbers is greater than 50%, we\u2019ve kept the maximum limit of the axis of all the linear gauges as 50%, and we compare how far away from that mark each continent is, as well as the global figure. We indicate at least partially vaccinated figures with LED representation, and the fully vaccinated numbers with a bar pointer. We\u2019ll see how the data is added in the last step.<\/p>\n<p>So then, our initial steps are all done, and now let\u2019s add the code to make a linear gauge chart with JavaScript!<\/p>\n<h3>4. Write the JavaScript code for the chart<\/h3>\n<p>Before adding any code, we enclose everything in a function that makes sure that the entire code inside it executes only once the page is loaded.<\/p>\n<p>Creating a linear gauge chart involves a couple of steps and is a bit more complex than the other basic chart types. But that doesn\u2019t mean it\u2019s very difficult, and we\u2019ll go through each step to understand how the chart is made.<\/p>\n<h4>Defining the Linear Scale and Axis for the Gauge Chart<\/h4>\n<p>We have multiple pointers in our chart. So, let\u2019s start with making a function that accepts two values: one for the bar pointer, and one for the LED gauge. We\u2019ll then create a gauge, set the data, and specify the layout as horizontal. Next, we\u2019ll set the range of the scales and the axes. We\u2019ll make a linear scale with the minimum and maximum ranges. For the axis, we\u2019ll define the attributes and set the orientation:<\/p>\n<pre><code class=\"javascript\">function drawGauge(value, settings) {\r\n  \/\/ Create gauge with settings\r\n  const gauge = anychart.gauges.linear();\r\n  gauge.data([value, settings.value]);\r\n  gauge.layout('horizontal');\r\n\r\n  \/\/ Set scale for gauge\r\n  const scale = anychart.scales.linear();\r\n  scale.minimum(0).maximum(settings.maximum).ticks({ interval: 2 });\r\n\r\n  \/\/ Set axis for gauge\r\n  const axis = gauge.axis(0);\r\n  axis.width('1%').offset('43%').scale(scale).orientation('bottom');\r\n}<\/code><\/pre>\n<h4>Setting the Bar Pointer and the Label<\/h4>\n<p>Now, we\u2019ll create the bar pointer and the label for the bar series. The label is given an offset to avoid overlap with the pointer:<\/p>\n<pre><code class=\"javascript\">\/\/ Create and set bar point\r\nconst barSeries = gauge.bar(0);\r\n\r\nbarSeries\r\n  .scale(scale)\r\n  .width('4%');\r\n\r\n\/\/ Create and set label with actual data\r\nconst labelBar = barSeries.labels();\r\nlabelBar\r\n  .enabled(true)\r\n  .offsetY('-15px');<\/code><\/pre>\n<h4>Creating the LED Pointer and Setting the Color Attribute<\/h4>\n<p>In the LED points, we\u2019ll specify the gap between the points and use the dimmer property to set the color of the residual LED points to indicate a non-lit effect. We\u2019ll also declare the color scale of the lit LED points:<\/p>\n<pre><code class=\"javascript\">\/\/ Create and set LED point\r\nconst ledPointer = gauge.led(1);\r\n\r\nledPointer\r\n  .offset('10%')\r\n  .width('30%')\r\n  .count(settings.maximum)\r\n  .scale(scale)\r\n  .gap(0.55)\r\n  .dimmer(function () {\r\n    return '#eee';\r\n  });\r\n\r\nledPointer.colorScale().colors(['#63b39b', '#63b39b']);<\/code><\/pre>\n<h4>Declaring the Gauges with the Target Value of Each Data Point<\/h4>\n<p>For making the linear gauge for each continent, we\u2019ll call the above defined function for every region with its data. The first number indicates the target value data, and the second variable is an object with the LED data. The <code>maximum<\/code> remains a constant 50, while <code>value<\/code> is the percent value of fully vaccinated population for each data point. This value will be displayed by the pointer:<\/p>\n<pre><code class=\"javascript\">\/\/ Create gauges\r\nconst world = drawGauge(13.68, { maximum: 50, value: 27.13 });\r\nconst europe = drawGauge(36.98, { maximum: 50, value: 47.28 });\r\nconst nAmerica = drawGauge(36.77, { maximum: 50, value: 46.53 });\r\nconst sAmerica = drawGauge(22.8, { maximum: 50, value: 40.54 });\r\nconst asia = drawGauge(10.14, { maximum: 50, value: 27.16 });\r\nconst oceania = drawGauge(9.75, { maximum: 50, value: 22.12 });\r\nconst africa = drawGauge(1.56, { maximum: 50, value: 3.04 });<\/code><\/pre>\n<h4>Setting the Layout of the Linear Gauges<\/h4>\n<p>To display each of the linear gauges one under the other, we\u2019ll define a table and add the title along with each data point as a separate row. We\u2019ll add the various properties of the layout, such as the alignment and font size. We\u2019ll also define parameters for the first row, since it\u2019s the title, and set the width attribute of first column to 100% since we don\u2019t need any more columns:<\/p>\n<pre><code class=\"javascript\">\/\/ Create table to place gauges\r\nconst layoutTable = anychart.standalones.table();\r\nlayoutTable\r\n  .hAlign('right')\r\n  .vAlign('middle')\r\n  .fontSize(14)\r\n  .cellBorder(null);\r\n\r\n\/\/ Put gauges into the layout table\r\nlayoutTable.contents([\r\n  [null, 'Covid-19 Vaccination - How far are we from the halfway mark?'],\r\n  ['World', world],\r\n  ['Europe', europe],\r\n  ['North America', nAmerica],\r\n  ['South America', sAmerica],\r\n  ['Asia', asia],\r\n  ['Oceania', oceania],\r\n  ['Africa', africa]\r\n]);\r\n\r\n\/\/ Set height for first row in layout table\r\nlayoutTable\r\n  .getRow(0)\r\n  .height(50)\r\n  .fontSize(22)\r\n  .hAlign('center');\r\n\r\n\/\/ Set the first column to 100% width\r\nlayoutTable.getCol(0).width(100);<\/code><\/pre>\n<h4>Drawing the Chart<\/h4>\n<p>The last step is to reference the <code>&lt;div&gt;<\/code> container that we added in the previous step, and to draw the chart:<\/p>\n<pre><code class=\"javascript\">\/\/ Set container id and initiate drawing\r\nlayoutTable.container('container');\r\nlayoutTable.draw();<\/code><\/pre>\n<p>And that\u2019s it. We now have a fully functional and beautiful JavaScript linear gauge chart! The code for this initial version of the linear gauge can be viewed on <a href=\"https:\/\/codepen.io\/SitePoint\/pen\/xxLwaQx\" target=\"_blank\" rel=\"nofollow\">CodePen<\/a> [and on <a href=\"https:\/\/playground.anychart.com\/8iaEyInt\/\" 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-8iaEyInt\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/8iaEyInt\/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-8iaEyInt{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>Making the Chart Accessible<\/h3>\n<p>It\u2019s always a good practice to make sure that charts are accessible to as many people as possible. So, keeping a11y in mind, we\u2019ve made a basic version of the linear gauge chart that\u2019s better suited for screen readers. You can check this out <a href=\"https:\/\/codepen.io\/SitePoint\/pen\/xxLwamx\" target=\"_blank\" rel=\"nofollow\">here<\/a> [or on <a href=\"https:\/\/playground.anychart.com\/mFBtbyXW\/\" target=\"_blank\" rel=\"nofollow\">AnyChart Playground<\/a>] and also read more about this aspect in the <a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Accessibility\/Overview\" target=\"_blank\" rel=\"nofollow\">documentation<\/a> of the AnyChart JavaScript library.<\/p>\n<h2>Customizing the Linear Gauge<\/h2>\n<p>The default linear gauge chart that we\u2019ve made looks awesome right now, but making a few modifications will enhance the readability and make the chart even more awesome. JavaScript libraries are perfect for not only creating charts quickly, but also for customizing the visualizations as required. The charting libraries offer a lot of configuration options for controlling the behavior and aesthetics of the charts. Let\u2019s make some small but effective tweaks to our current linear gauge chart.<\/p>\n<h3>Color modification<\/h3>\n<p>To make the linear gauge look more cohesive, let\u2019s make the color attribute of the bar pointer a darker version of the LED points. We\u2019ll that by specifying the fill and stroke attributes of the bar:<\/p>\n<pre><code class=\"javascript\">\/\/ Create and set bar point\r\nconst barSeries = gauge.bar(0);\r\nbarSeries\r\n  .scale(scale)\r\n  .width('4%')\r\n  .fill('#296953')\r\n  .stroke('#296953');<\/code><\/pre>\n<h3>Adding a legend to our linear gauge chart<\/h3>\n<p>Since we\u2019ve used different colors for the bar, the lit and non-lit LED pointers, it\u2019s a good practice to provide a legend to explain the colors. We\u2019ll make a legend and add it below the title of the chart:<\/p>\n<pre><code class=\"javascript\">\/\/ Create stand alone legend\r\nconst legend = anychart.standalones.legend();\r\nlegend\r\n  .position('center')\r\n  .items([\r\n    { text: 'Fully vaccinated', iconFill: '#296953' },\r\n    { text: 'Partially vaccinated', iconFill: '#63b39b' },\r\n    { text: 'Not vaccinated', iconFill: '#eee' }\r\n  ]);<\/code><\/pre>\n<h3>Tooltip formatting<\/h3>\n<p>To facilitate better data communication, let\u2019s format the tooltip to make it more informational by displaying the values in percentage form and indicating that the maximum value for the gauge is 50%:<\/p>\n<pre><code class=\"javascript\">\/\/ Set gauge tooltip\r\ngauge\r\n  .tooltip()\r\n    .useHtml(true)\r\n    .titleFormat('{%Value} %')\r\n  .format(\r\n    'Maximum on scale: ' +\r\n    settings.maximum +\r\n    ' %'\r\n  );<\/code><\/pre>\n<p>Check out the entire code for this version on <a href=\"https:\/\/codepen.io\/SitePoint\/pen\/dyzYqrX\" target=\"_blank\" rel=\"nofollow\">CodePen<\/a> [or on <a href=\"https:\/\/playground.anychart.com\/3bnJzIE4\/\" target=\"_blank\" rel=\"nofollow\">AnyChart Playground<\/a>].<\/p>\n<h3>Axis and labels formatting<\/h3>\n<p>The last thing we\u2019ll do is display all the data values as percentage values to avoid any confusion. We\u2019ll also add a subtitle as a row in the table below the title to indicate that values are percentages. One final thing will be to beautify the bar labels with bolder fonts.<\/p>\n<p>The entire final code for this JavaScript linear gauge chart can be found on <a href=\"https:\/\/codepen.io\/SitePoint\/pen\/BadoOEJ\" target=\"_blank\" rel=\"nofollow\">CodePen<\/a> [and <a href=\"https:\/\/playground.anychart.com\/0Plt8l1n\" 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-0Plt8l1n\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/0Plt8l1n\/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-0Plt8l1n{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h2>Conclusion<\/h2>\n<p>In this step-by-step tutorial, we\u2019ve seen how creating functional and visually appealing JavaScript charts is not too difficult with a good JavaScript library. Check out the documentation and examples to better understand the features and properties of the linear gauge. Please ask any questions if in doubt about this chart or other visualizations.<\/p>\n<p>There are multiple chart options provided by <a href=\"https:\/\/www.anychart.com\/products\/anychart\/gallery\/\">AnyChart<\/a>, and there are many other JavaScript charting libraries as well for creating beautiful visualizations.<\/p>\n<p>Let\u2019s all get vaccinated and stay healthy to get on with creating more visualizations!<\/p>\n<hr \/>\n<p><strong><em>Published with the permission of Shachee Swadia. Originally appeared on <a href=\"https:\/\/www.sitepoint.com\/create-linear-gauge-chart-javascript\/\" target=\"_blank\" rel=\"nofollow\">SitePoint<\/a> under the title <em>&#8220;How to Create a Linear Gauge Chart in JavaScript&#8221;<\/em> on October 19, 2021.<\/em><\/strong><\/p>\n<hr \/>\n<p><strong><em>Learn more about linear gauges on <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/linear-gauge\/\">Chartopedia<\/a>, a free guide for choosing the right chart types, and\u00a0check out other <a href=\"https:\/\/www.anychart.com\/blog\/category\/javascript-chart-tutorials\/\">JavaScript charting tutorials<\/a> on our blog.<\/em><\/strong><\/p>\n<hr \/>\n<p><strong><em>Want to write a guest post?\u00a0<a href=\"https:\/\/www.anychart.com\/support\/\">Share<\/a> your idea with us and let&#8217;s get it rolling!<\/em><\/strong><\/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>This article presents an easy-to-follow guide for building an interactive linear gauge chart in JavaScript. We\u2019ll show how to quickly create a cool and interactive linear gauge chart that highlights Covid-19 vaccination data around the world. Our chart will allow us to visualize the status of Covid-19 vaccination at the time of writing, and will [&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,23,13,279,4],"tags":[53,260,254,1758,284,127,166,258,1766,1773,1771,1772,1819,1800,1801,1803,1804,1925,2139,1769,1975,1954,1974,1935,1948,160,49,471,266,620,1292,880,806,1759,509,2220,54,1389,1760,2757,256,1111,842,844,165,313,1370,133,774,179,1498,805,220,219,1762,2013,2014,32,55,144,167,146,433,152,2949,151,36,907,141,249,81,57,2981,1238,142,99,134,58,65,56,2980,101,222,1768,679,1817,1601,171,459,30,172,2250,2675,2676,1947,2674,2816,1763,804,1767],"class_list":["post-13821","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-best-data-visualization-examples","tag-chart","tag-chart-design","tag-chart-examples","tag-chart-types","tag-charting","tag-charts","tag-coronavirus","tag-coronavirus-charts","tag-coronavirus-data","tag-coronavirus-data-visualization","tag-coronavirus-outbreak","tag-coronavirus-pandemic","tag-coronavirus-pandemic-charts","tag-coronavirus-pandemic-data","tag-coronavirus-pandemic-data-visualization","tag-covid","tag-covid-crisis","tag-covid-19","tag-covid-19-analytics","tag-covid-19-charts","tag-covid-19-outbreak","tag-covid-19-statistics","tag-covid-19-vaccine","tag-dashboard-design","tag-dashboards","tag-data-analysis","tag-data-analytics","tag-data-analytics-examples","tag-data-chart","tag-data-charting","tag-data-charts","tag-data-design","tag-data-graphics","tag-data-visual","tag-data-visualization","tag-data-visualization-best-pracices","tag-data-visualization-design","tag-data-visualization-development","tag-data-visualization-examples","tag-data-visualization-practice","tag-data-visualization-task","tag-data-visualization-tutorial","tag-data-visualizations","tag-data-visuals","tag-data-viz-examples","tag-dataviz","tag-dataviz-examples","tag-design","tag-example","tag-front-end-development","tag-gauge-charts","tag-gauges","tag-guest-post","tag-html","tag-html-charts","tag-html5","tag-html5-charts","tag-infographics","tag-interactive-charts","tag-interactive-data-visualization","tag-interactive-graphics","tag-interactive-infographic","tag-interactive-infographics","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-gauge","tag-javascript-graph","tag-javascript-graphics","tag-javascript-library","tag-javascript-technologies","tag-js-chart","tag-js-charting","tag-js-charts","tag-js-gauge","tag-js-graphics","tag-linear-gauges","tag-novel-coronavirus","tag-our-world-in-data","tag-pandemic","tag-pandemics","tag-sitepoint","tag-statistics","tag-tips-and-tricks","tag-tutorial","tag-vaccination","tag-vaccination-rates","tag-vaccination-rates-visualization","tag-vaccine","tag-vaccine-skepticism","tag-web-design","tag-web-developers","tag-web-development","tag-wuhan-coronavirus","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating Linear Gauge Chart in JavaScript \u2014 Tutorial<\/title>\n<meta name=\"description\" content=\"Visualization helps us better understand data. Learn how to create an interactive Linear Gauge Chart in JavaScript, highlighting Covid-19 vaccination stats.\" \/>\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\/2021\/10\/20\/linear-gauge-chart-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial\" \/>\n<meta property=\"og:description\" content=\"Learn how to quickly build an interactive Linear Gauge Chart in JavaScript \u2014 visualizing Covid-19 vaccination data.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-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=\"2021-10-20T09:48:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-13T11:09:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5-social.png\" \/>\n<meta name=\"author\" content=\"Shachee Swadia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial\" \/>\n<meta name=\"twitter:description\" content=\"Learn how to quickly build an interactive Linear Gauge Chart in JavaScript \u2014 visualizing Covid-19 vaccination data.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5-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=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/\"},\"author\":{\"name\":\"Shachee Swadia\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51\"},\"headline\":\"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial\",\"datePublished\":\"2021-10-20T09:48:37+00:00\",\"dateModified\":\"2022-08-13T11:09:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/\"},\"wordCount\":1796,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png\",\"keywords\":[\"AnyChart\",\"best data visualization examples\",\"chart\",\"chart design\",\"chart examples\",\"chart types\",\"charting\",\"charts\",\"coronavirus\",\"coronavirus charts\",\"coronavirus data\",\"coronavirus data visualization\",\"coronavirus outbreak\",\"coronavirus pandemic\",\"coronavirus pandemic charts\",\"coronavirus pandemic data\",\"coronavirus pandemic data visualization\",\"covid\",\"COVID crisis\",\"COVID-19\",\"COVID-19 analytics\",\"COVID-19 charts\",\"COVID-19 outbreak\",\"COVID-19 statistics\",\"COVID-19 vaccine\",\"dashboard design\",\"Dashboards\",\"data analysis\",\"data analytics\",\"data analytics examples\",\"data chart\",\"data charting\",\"data charts\",\"data design\",\"data graphics\",\"data visual\",\"Data Visualization\",\"data visualization best practices\",\"data visualization design\",\"data visualization development\",\"data visualization examples\",\"data visualization practice\",\"data visualization task\",\"data visualization tutorial\",\"data visualizations\",\"data visuals\",\"data viz examples\",\"dataviz\",\"dataviz examples\",\"design\",\"example\",\"front-end development\",\"gauge charts\",\"gauges\",\"guest post\",\"HTML\",\"HTML charts\",\"HTML5\",\"html5 charts\",\"infographics\",\"interactive charts\",\"interactive data visualization\",\"interactive graphics\",\"interactive infographic\",\"interactive infographics\",\"interactive visualizations\",\"JavaScript\",\"javascript chart tutorial\",\"javascript charting\",\"javascript charting api\",\"JavaScript charting library\",\"javascript charts\",\"javascript gauge\",\"javascript graph\",\"javascript graphics\",\"JavaScript library\",\"javascript technologies\",\"js chart\",\"js charting\",\"js charts\",\"js gauge\",\"JS graphics\",\"linear gauges\",\"novel coronavirus\",\"Our World in Data\",\"pandemic\",\"pandemics\",\"sitepoint\",\"statistics\",\"Tips and tricks\",\"tutorial\",\"vaccination\",\"vaccination rates\",\"vaccination rates visualization\",\"vaccine\",\"vaccine skepticism\",\"web design\",\"web developers\",\"web development\",\"Wuhan coronavirus\"],\"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\/2021\/10\/20\/linear-gauge-chart-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/\",\"name\":\"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png\",\"datePublished\":\"2021-10-20T09:48:37+00:00\",\"dateModified\":\"2022-08-13T11:09:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51\"},\"description\":\"Visualization helps us better understand data. Learn how to create an interactive Linear Gauge Chart in JavaScript, highlighting Covid-19 vaccination stats.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#primaryimage\",\"url\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png\",\"contentUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png\",\"width\":1600,\"height\":840},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial\"}]},{\"@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":"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial","description":"Visualization helps us better understand data. Learn how to create an interactive Linear Gauge Chart in JavaScript, highlighting Covid-19 vaccination stats.","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\/2021\/10\/20\/linear-gauge-chart-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial","og_description":"Learn how to quickly build an interactive Linear Gauge Chart in JavaScript \u2014 visualizing Covid-19 vaccination data.","og_url":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2021-10-20T09:48:37+00:00","article_modified_time":"2022-08-13T11:09:12+00:00","og_image":[{"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5-social.png","type":"","width":"","height":""}],"author":"Shachee Swadia","twitter_card":"summary_large_image","twitter_title":"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial","twitter_description":"Learn how to quickly build an interactive Linear Gauge Chart in JavaScript \u2014 visualizing Covid-19 vaccination data.","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5-social.png","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Shachee Swadia","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/"},"author":{"name":"Shachee Swadia","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51"},"headline":"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial","datePublished":"2021-10-20T09:48:37+00:00","dateModified":"2022-08-13T11:09:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/"},"wordCount":1796,"commentCount":0,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png","keywords":["AnyChart","best data visualization examples","chart","chart design","chart examples","chart types","charting","charts","coronavirus","coronavirus charts","coronavirus data","coronavirus data visualization","coronavirus outbreak","coronavirus pandemic","coronavirus pandemic charts","coronavirus pandemic data","coronavirus pandemic data visualization","covid","COVID crisis","COVID-19","COVID-19 analytics","COVID-19 charts","COVID-19 outbreak","COVID-19 statistics","COVID-19 vaccine","dashboard design","Dashboards","data analysis","data analytics","data analytics examples","data chart","data charting","data charts","data design","data graphics","data visual","Data Visualization","data visualization best practices","data visualization design","data visualization development","data visualization examples","data visualization practice","data visualization task","data visualization tutorial","data visualizations","data visuals","data viz examples","dataviz","dataviz examples","design","example","front-end development","gauge charts","gauges","guest post","HTML","HTML charts","HTML5","html5 charts","infographics","interactive charts","interactive data visualization","interactive graphics","interactive infographic","interactive infographics","interactive visualizations","JavaScript","javascript chart tutorial","javascript charting","javascript charting api","JavaScript charting library","javascript charts","javascript gauge","javascript graph","javascript graphics","JavaScript library","javascript technologies","js chart","js charting","js charts","js gauge","JS graphics","linear gauges","novel coronavirus","Our World in Data","pandemic","pandemics","sitepoint","statistics","Tips and tricks","tutorial","vaccination","vaccination rates","vaccination rates visualization","vaccine","vaccine skepticism","web design","web developers","web development","Wuhan coronavirus"],"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\/2021\/10\/20\/linear-gauge-chart-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/","url":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/","name":"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png","datePublished":"2021-10-20T09:48:37+00:00","dateModified":"2022-08-13T11:09:12+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51"},"description":"Visualization helps us better understand data. Learn how to create an interactive Linear Gauge Chart in JavaScript, highlighting Covid-19 vaccination stats.","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#primaryimage","url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png","contentUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2021\/10\/linear-gauge-chart-javascript-html5.png","width":1600,"height":840},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2021\/10\/20\/linear-gauge-chart-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating Linear Gauge Chart in JavaScript \u2014 Tutorial"}]},{"@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\/13821","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=13821"}],"version-history":[{"count":18,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/13821\/revisions"}],"predecessor-version":[{"id":15518,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/13821\/revisions\/15518"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=13821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=13821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=13821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}