{"id":11873,"date":"2020-12-22T10:13:47","date_gmt":"2020-12-22T10:13:47","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=11873"},"modified":"2022-08-13T11:02:47","modified_gmt":"2022-08-13T11:02:47","slug":"marimekko-chart-javascript","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/","title":{"rendered":"Building Marimekko Chart with JavaScript"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignnone size-full wp-image-11900\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png\" alt=\"A Marimekko Chart built with JavaScript displayed on a laptop screen\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png 1100w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial-300x158.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial-768x404.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial-1024x538.png 1024w\" sizes=\"(max-width: 1100px) 100vw, 1100px\" \/>Would you like to know how to\u00a0easily create an interactive Marimekko chart\u00a0for HTML5 based apps and Web pages using JavaScript? If yes, you are on the best path to learning this.<\/p>\n<p>Also known as <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/mekko-chart\/\">Mekko charts<\/a>\u00a0and market maps, Marimekko charts display numerical values that vary from 0% to 100% in its Y-axis. The most exciting part lies in their X-axis, which indicates the sum of values within categories. Each category&#8217;s width along the X-axis portraits the whole category&#8217;s contribution to a total of all data. In simple words, this is a type of a stacked chart that visualizes categorical data. Still, both the Y and X axes vary in a percentage scale by determining each segment&#8217;s width and height.<\/p>\n<p>Are you a smartphone enthusiast and interested\u00a0to\u00a0look at\u00a0the\u00a0global smartphone shipments in 2019 by quarter and by vendor?\u00a0Then especially follow the present tutorial as\u00a0we are to visualize this market data in an elegant Marimekko\u00a0diagram\u00a0using\u00a0simple JS chart coding techniques.<\/p>\n<p><!--more Read the JS charting tutorial \u00bb--><\/p>\n<h2>How to Create Basic JS Marimekko Chart<\/h2>\n<p>The general order of visualizing data in JavaScript charts\u00a0consists of the following simple four steps, and building a JS Marimekko chart is not an exception:<\/p>\n<ul>\n<ol>\n<li>Create an HTML page with a container to display the chart.<\/li>\n<li>Connect all the scripts you need.<\/li>\n<li>Load the data you need to visualize in the chart.<\/li>\n<li>Finally, write the JS charting code.<\/li>\n<\/ol>\n<\/ul>\n<p>Now, let&#8217;s dig into each of these steps to\u00a0draw our nifty Marimekko chart.<\/p>\n<h3>Step 1: Create an HTML page<\/h3>\n<p>The first step is to set up a basic HTML page to place the Marimekko chart.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n\u00a0\u00a0&lt;head&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;title&gt;My Marimekko Chart Example&lt;\/title&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;style&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0html, body, #container {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0width: 100%;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0height: 100%;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0margin: 0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0padding: 0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0&lt;\/style&gt;\r\n\u00a0\u00a0&lt;\/head&gt;\r\n\u00a0\u00a0&lt;body&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n<em><span style=\"color: silver;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ Marimekko chart code goes here<\/span><\/em>\r\n\u00a0\u00a0&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<p>The HTML page\u00a0developed above consists of two main sections, the header (between <code>&lt;head&gt;<\/code><code>&lt;\/head&gt;<\/code> tags) and the body of the page (between <code>&lt;body&gt;<\/code><code>&lt;\/body&gt;<\/code> tags). In the header section, we have set the HTML page title (between <code>&lt;title&gt;<\/code><code>&lt;\/title&gt;<\/code> tags) and CSS rules (between <code>&lt;style&gt;<\/code><code>&lt;\/style&gt;<\/code> tags) to manage the <code>container<\/code> element&#8217;s appearance.<\/p>\n<p>The <code>div<\/code> element in the body section whose id is <code>container<\/code>, is the block that will be used to place our Marimekko chart. Since I want the graphic to appear on the entire HTML page, I have set the container element&#8217;s width and height fields to 100%. So the chart will\u00a0be displayed\u00a0across the whole page.<\/p>\n<h3>Step 2: Connect all required scripts<\/h3>\n<p>Next, we should connect all the JavaScript scripts that are required to build\u00a0a Marimekko chart.<\/p>\n<p>Generally, these simple steps to build a Marimekko or basically any other chart are quite the same for all JavaScript charting libraries. In this tutorial, I will take <a href=\"https:\/\/www.anychart.com\">AnyChart<\/a> as an example. It is a popular flexible JS library for interactive data visualization, which has great <a href=\"https:\/\/docs.anychart.com\" target=\"_blank\" rel=\"nofollow\">documentation<\/a> and <a href=\"https:\/\/api.anychart.com\" target=\"_blank\" rel=\"nofollow\">API reference<\/a>, and a lot of <a href=\"https:\/\/www.anychart.com\/products\/anychart\/gallery\/\">demos<\/a>, so it looks easy to get started with even for beginners.<\/p>\n<p>AnyChart has a modular system, which means you do not need the entire library and can connect only those chart types and features that you need in reality. In this way, the size of the JavaScript code running on your web page is significantly reduced. It is always good for performance. So, the &#8216;base&#8217; and &#8216;mekko&#8217; modules should be used in our case to\u00a0represent data in\u00a0a Marimekko chart. They will be referenced in the <code>&lt;head&gt;<\/code><code>&lt;\/head&gt;<\/code> section,\u00a0in the\u00a0<code>&lt;script&gt;<\/code><code>&lt;\/script&gt;<\/code> tags.<\/p>\n<pre><code class=\"html\">&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.9.0\/js\/anychart-base.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.9.0\/js\/anychart-mekko.min.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n<p>The JavaScript code required to build the Marimekko chart should be written between the <code>&lt;body&gt;<\/code><code>&lt;\/body&gt;<\/code> tags of the HTML page.<\/p>\n<p>Following is the look of the code with new changes. Isn&#8217;t it cool? Keep on reading, guys. We are getting close to the most exciting part.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n\u00a0\u00a0&lt;head&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;title&gt;My Marimekko Chart Example&lt;\/title&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.9.0\/js\/anychart-base.min.js\"&gt;&lt;\/script&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.9.0\/js\/anychart-mekko.min.js\"&gt;&lt;\/script&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;style&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0html, body, #container {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0width: 100%;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0height: 100%;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0margin: 0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0padding: 0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0&lt;\/style&gt;\r\n\u00a0\u00a0&lt;\/head&gt;\r\n\u00a0\u00a0&lt;body&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;script&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ Marimekko chart code goes here\r\n\u00a0\u00a0\u00a0\u00a0&lt;\/script&gt;\r\n\u00a0\u00a0&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<h3>Step 3: Load the data you want to visualize<\/h3>\n<p>As stated at the beginning of this tutorial, Marimekko belongs to the 2D stacked chart family, but it illustrates an additional dimension of data through varying column widths. This chart type is widely being used to interpret sales data and perform marketing analysis, but make sure you&#8217;ve picked\u00a0data appropriately based on your requirement.<\/p>\n<p>Are you curious about the number of global shipments of your favorite smartphone brand in 2019? Wait, let&#8217;s go more in-depth and\u00a0visualize the shipments quarterly so that the data will be suitable to fit into a Marimekko chart.<\/p>\n<p>In the present case,\u00a0a Marimekko chart will be used to illustrate the top six brands of smartphone shipments (in millions) in 2019, quarterly. Following is the dataset that we\u2019ll be using. (Source: <a href=\"https:\/\/www.idc.com\" target=\"_blank\" rel=\"nofollow\">IDC<\/a>.)<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<th style=\"padding: 15px; text-align: center;\"><\/th>\n<th style=\"padding: 15px; text-align: center;\">Huawei<\/th>\n<th style=\"padding: 15px; text-align: center;\">Vivo<\/th>\n<th style=\"padding: 15px; text-align: center;\">Apple<\/th>\n<th style=\"padding: 15px; text-align: center;\">Samsung<\/th>\n<th style=\"padding: 15px; text-align: center;\">Xiaomi<\/th>\n<th style=\"padding: 15px; text-align: center;\">Oppo<\/th>\n<th style=\"padding: 15px; text-align: center;\">Other<\/th>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">Q1<\/td>\n<td style=\"padding: 6px 15px;\">59.1<\/td>\n<td style=\"padding: 6px 15px;\">23.9<\/td>\n<td style=\"padding: 6px 15px;\">42<\/td>\n<td style=\"padding: 6px 15px;\">72<\/td>\n<td style=\"padding: 6px 15px;\">27.8<\/td>\n<td style=\"padding: 6px 15px;\">25.7<\/td>\n<td style=\"padding: 6px 15px;\">90.5<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">Q2<\/td>\n<td style=\"padding: 6px 15px;\">56.6<\/td>\n<td style=\"padding: 6px 15px;\">27<\/td>\n<td style=\"padding: 6px 15px;\">36.5<\/td>\n<td style=\"padding: 6px 15px;\">76.3<\/td>\n<td style=\"padding: 6px 15px;\">32.3<\/td>\n<td style=\"padding: 6px 15px;\">30.6<\/td>\n<td style=\"padding: 6px 15px;\">97.7<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">Q3<\/td>\n<td style=\"padding: 6px 15px;\">66.8<\/td>\n<td style=\"padding: 6px 15px;\">31.3<\/td>\n<td style=\"padding: 6px 15px;\">44.8<\/td>\n<td style=\"padding: 6px 15px;\">78.2<\/td>\n<td style=\"padding: 6px 15px;\">31.7<\/td>\n<td style=\"padding: 6px 15px;\">32.3<\/td>\n<td style=\"padding: 6px 15px;\">94.9<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 6px 15px;\">Q4<\/td>\n<td style=\"padding: 6px 15px;\">56.2<\/td>\n<td style=\"padding: 6px 15px;\">31.5<\/td>\n<td style=\"padding: 6px 15px;\">72.3<\/td>\n<td style=\"padding: 6px 15px;\">70.4<\/td>\n<td style=\"padding: 6px 15px;\">32.9<\/td>\n<td style=\"padding: 6px 15px;\">31.4<\/td>\n<td style=\"padding: 6px 15px;\">106.4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\nThe wonder of Mekko graphics is that both axes represent data on a percentage scale, but you need to put actual data only and the chart calculates everything automatically.<\/p>\n<p>We transformed the\u00a0mobile shipment data into a particular JavaScript object as shown below. It holds the data header settings, the title, and the data itself as an array of arrays.<\/p>\n<p>The X-axis contains each smartphone brand\u2019s total shipments, while the Y-axis is used to read each smartphone brand\u2019s percentage of shipments\u00a0by quarter.<\/p>\n<p>Following is the dataset that we&#8217;ll be using. The <code>header<\/code> setting of the JavaScript object below is used to set the quarter details of each smartphone producer brand. Hence, we will see quarter-wise relationships.<\/p>\n<pre><code class=\"javascript\">var data = {\r\n  title: 'Global Smartphone Shipments (In Millions) in 2019, quarterly',\r\n  header: ['Name', 'Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'],\r\n  rows: [\r\n    ['Huawei', 59.1,56.6,66.8,56.2],\r\n    ['Vivo', 23.9,27,31.3,31.5],\r\n    ['Apple', 42,36.5,44.8,72.3],\r\n    ['Samsung', 72,76.3,78.2,70.4],\r\n    ['Xiaomi', 27.8,32.3,31.7,32.9],\r\n    ['Oppo', 25.7,30.6,32.3,31.4],\r\n    ['Others', 90.5,97.7,94.9,106.4],\r\n  ]\r\n};<\/code><\/pre>\n<h3>Step 4: Writing the JS Marimekko chart code<\/h3>\n<p>Once all the preparations are done, we can step into the final section to display the most awaited Marimekko chart. The entire JavaScript chart code responsible for displaying the Marimekko chart must be inserted inside the <code>anychart.onDocumentReady()<\/code> function which is written within the <code>&lt;script&gt;<\/code> tag. As the function&#8217;s name suggests, it waits until the page is ready to display the data.<\/p>\n<pre><code class=\"html\">&lt;script&gt;\r\n  anychart.onDocumentReady(function() {\r\n    \/\/ The entire JavaScript code of the Marimekko chart will be here\r\n  });\r\n&lt;\/script&gt;<\/code><\/pre>\n<p>Then, use the code from step 3 to generate the data that needs to be fed to the Mekko chart.<\/p>\n<pre><code class=\"javascript\">var data = {\r\n  title: 'Global Smartphone Shipments (In Millions) in 2019, quarterly',\r\n  header: ['Name', 'Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'],\r\n  rows: [\r\n    ['Huawei', 59.1,56.6,66.8,56.2],\r\n    ['Vivo', 23.9,27,31.3,31.5],\r\n    ['Apple', 42,36.5,44.8,72.3],\r\n    ['Samsung', 72,76.3,78.2,70.4],\r\n    ['Xiaomi', 27.8,32.3,31.7,32.9],\r\n    ['Oppo', 25.7,30.6,32.3,31.4],\r\n    ['Others', 90.5,97.7,94.9,106.4],\r\n  ]\r\n};<\/code><\/pre>\n<p>The next step is to specify the JS chart type. In this case, we should use the <code>mekko<\/code> chart and feed it with the data to be visualized in a Marimekko chart.<\/p>\n<pre><code class=\"javascript\">\/\/ create a mekko (marimekko) chart\r\nvar chart = anychart.mekko();\r\n\/\/ set the chart data\r\nchart.data(data);<\/code><\/pre>\n<p>Let\u2019s enable the legend of the chart like below.<\/p>\n<pre><code>\/\/ enable the chart legend\r\nchart.legend(true);<\/code><\/pre>\n<p>Finally, command to draw the Marimekko chart in the container:<\/p>\n<pre><code>\/\/ set the chart container id\r\nchart.container('container');\r\n\/\/ draw the resulting marimekko chart\r\nchart.draw();<\/code><\/pre>\n<p>Here comes what we&#8217;ve waited for. (See this basic Marimekko chart on <a href=\"https:\/\/playground.anychart.com\/xZ1hInAb\/\" target=\"_blank\" rel=\"nofollow\">AnyChart Playground<\/a>.)<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-\" src=\"https:\/\/playground.anychart.com\/xZ1hInAb\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><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-{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<p>The complete code of the basic interactive HTML5 Marimekko chart\u00a0above is\u00a0below.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n\u00a0\u00a0&lt;head&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;title&gt;My Marimekko Chart Example&lt;\/title&gt;\r\n\u00a0\u00a0&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.9.0\/js\/anychart-base.min.js\"&gt;&lt;\/script&gt;\r\n\u00a0\u00a0&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.9.0\/js\/anychart-mekko.min.js\"&gt;&lt;\/script&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;style&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0html, body, #container {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0width: 100%;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0height: 100%;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0margin: 0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0padding: 0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0&lt;\/style&gt;\r\n\u00a0\u00a0&lt;\/head&gt;\r\n\u00a0\u00a0&lt;body&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;div id=\"container\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;script&gt;\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0anychart.onDocumentReady(function () {\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ create data\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var data = {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0title: 'Global Smartphone Shipments (In Millions) in 2019',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0header: ['Name', 'Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'],\r\n          rows: [\r\n            ['Huawei', 59.1,56.6,66.8,56.2],\r\n            ['Vivo', 23.9,27,31.3,31.5],\r\n            ['Apple', 42,36.5,44.8,72.3],\r\n            ['Samsung', 72,76.3,78.2,70.4],\r\n            ['Xiaomi', 27.8,32.3,31.7,32.9],\r\n            ['Oppo', 25.7,30.6,32.3,31.4],\r\n            ['Others', 90.5,97.7,94.9,106.4],\r\n          ]\r\n        };\r\n\r\n        \/\/ create a mekko (marimekko) chart\r\n        var chart = anychart.mekko();\r\n\r\n        \/\/ set the chart data\r\n        chart.data(data);\r\n\r\n        \/\/ enable the chart legend\r\n        chart.legend(true);\r\n\r\n        \/\/ set the chart container id\r\n        chart.container('container');\r\n\r\n        \/\/ draw the resulting marimekko chart\r\n        chart.draw();\r\n\r\n      });\r\n\r\n\u00a0\u00a0\u00a0\u00a0&lt;\/script&gt;\r\n\u00a0\u00a0&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2>Customizing JS Marimekko Chart<\/h2>\n<p>Well, this section is to add some icing on the cake. You have substantial <a href=\"https:\/\/docs.anychart.com\/Basic_Charts\/Marimekko_Chart\/Mekko_Chart\" target=\"_blank\" rel=\"nofollow\">documentation resources<\/a> in AnyChart, where can you obtain in-depth knowledge to improve, alter, and customize the generated charts. For inspiration, check the <a href=\"https:\/\/www.anychart.com\/products\/anychart\/gallery\/Mekko_(Marimekko)_and_Mosaic_Charts\/\">demo gallery<\/a>.<\/p>\n<p>Let&#8217;s try to modify our JavaScript Marimekko chart to give it a more elegant look.<\/p>\n<h3>Use palettes to change the chart color<\/h3>\n<p>The color of the Marimekko charts can be customized using the Palettes option. Refer to <a href=\"https:\/\/docs.anychart.com\/Appearance_Settings\/Palettes\" target=\"_blank\" rel=\"nofollow\">this manual<\/a>\u00a0to find more details on AnyChart Palettes. In the below instance we apply the Wines palette. There are many more pre-built color palettes, awaiting you.<\/p>\n<pre><code class=\"javascript\">\/\/ apply a palette for coloring\r\nchart.palette(anychart.palettes.wines);<\/code><\/pre>\n<p>Doesn&#8217;t the chart look handy with its new colors? (See it on <a href=\"https:\/\/playground.anychart.com\/OVq82Lgy\/\" target=\"_blank\" rel=\"nofollow\">AnyChart Playground<\/a>.)<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-\" src=\"https:\/\/playground.anychart.com\/OVq82Lgy\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><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-{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>Format the chart axes<\/h3>\n<p>Following code extras are used to <a href=\"https:\/\/docs.anychart.com\/Axes_and_Grids\/Axis_Basics\" target=\"_blank\" rel=\"nofollow\">format the axes<\/a> by adding titles and changing the orientation of the axes.<\/p>\n<p>Here&#8217;s the code to include the axis titles:<\/p>\n<pre><code class=\"javascript\">\/\/ set the x-axis title\r\nchart.xAxis().title('Smartphone Shipments by Brands');\r\n\/\/ set the y-axis title\r\nchart.yAxis().title('Smartphone Shipments by Quarters %');<\/code><\/pre>\n<p>The orientation of the Y-axis\u00a0can be either left or right. The default value is left. The orientation of the X-axis can be set either as top or bottom and by default it gets set to bottom.\u00a0Configure them based on your interest. Following changes are made in the orientation of both axes. For the demonstration purpose, the orientation of the X-axis and Y-axis\u00a0will be set as top and right.<\/p>\n<pre><code class=\"javascript\">\/\/ set the x-axis orientation\r\nchart.xAxis().orientation(\"top\");\r\n\/\/ set the y-axis orientation\r\nchart.yAxis().orientation(\"right\");\r\n<\/code><\/pre>\n<p>The chart seems more readable with axes titles. (See it on <a href=\"https:\/\/playground.anychart.com\/0mJHN97o\/\" target=\"_blank\" rel=\"nofollow\">AnyChart Playground<\/a>.)<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-\" src=\"https:\/\/playground.anychart.com\/0mJHN97o\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><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-0mJHN97o{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<p>From the next example onwards, the Marimekko chart axes&#8217; orientation is\u00a0returned\u00a0to\u00a0the default look.<\/p>\n<h3>Format the chart\u00a0tooltips<\/h3>\n<p>Tooltips are usually hidden but they\u00a0become visible when hovering over the chart&#8217;s points. This can be used to display additional useful information.<\/p>\n<p>As the first step, let\u2019s generate information that needs to be displayed when hovering. According to the following code snippet, we display the <code>seriesName<\/code> (the quarter), and <code>value<\/code> (the shipment amount for the corresponding quarter, in USD million).<\/p>\n<pre><code class=\"javascript\">\/\/ customize the tooltip format\r\nchart.tooltip().format('{%seriesName}: ${%Value}M');<\/code><\/pre>\n<p>The &#8216;union&#8217; display mode helps to show the data for all quarters at once.<\/p>\n<pre><code class=\"javascript\">\/\/ set the tooltip display mode\r\nchart.tooltip().displayMode(\"union\");<\/code><\/pre>\n<p>Following is just another simple modification performed to the Marimekko chart tooltip title&#8217;s visual appearance. We can change font size, background appearance, and font weight as shown below.<\/p>\n<pre><code class=\"javascript\">\/\/ customize the tooltip title\r\nvar title = chart.tooltip().title();\r\ntitle.fontFamily(\"Calibri\");\r\ntitle.fontDecoration(\"underline\");\r\ntitle.fontWeight(700);\r\ntitle.fontSize(18);<\/code><\/pre>\n<p>Our JS-based\u00a0Marimekko chart seems to be getting even better and more readable. (See it on <a href=\"https:\/\/playground.anychart.com\/nHEAdkRg\/\" target=\"_blank\" rel=\"nofollow\">AnyChart Playground<\/a>.)<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-\" src=\"https:\/\/playground.anychart.com\/nHEAdkRg\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><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-{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>Format the chart\u00a0label settings<\/h3>\n<p>A label is a text box that can be displayed along with a point on a chart. Labels typically indicate information that each point contains.\u00a0Let&#8217;s configure the labels in this Marimekko chart to add that the shipment value for each quarter is displayed in millions of US dollars.<\/p>\n<pre><code class=\"javascript\">\/\/ set the chart labels settings\r\nchart.labels().format('${%Value}M');<\/code><\/pre>\n<p>Finally, this is how our interactive Marimekko chart looks like after making the relevant customizations as suggested above. (See it on <a href=\"https:\/\/playground.anychart.com\/XluPu7xv\/\" target=\"_blank\" rel=\"nofollow\">AnyChart Playground<\/a>.)<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-XluPu7xv\" src=\"https:\/\/playground.anychart.com\/XluPu7xv\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><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-XluPu7xv{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<p>The newly customized, advanced Marimekko chart looks more informative and attractive than the initial visualization. You can give your creative touch to present the chart with more details.<\/p>\n<p>According to the finalized Marimekko chart, Samsung was the leading smartphone vendor worldwide in 2019. But be aware, Samsung! Huawei seems to challenge you soon. Did you notice that Apple had performed exceptionally well in the fourth quarter, beating all its competitors? The success story behind this outstanding achievement was the unveiling of the iPhone 11 series, which caught the eye of so many people all over the globe.<\/p>\n<p>Play with your data, guys, because they are waiting to reveal exciting information for you.<\/p>\n<p>Below is the full HTML code for the final Marimekko chart in this tutorial:<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n\u00a0\u00a0&lt;head&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;title&gt;My Marimekko Chart Example&lt;\/title&gt;\r\n\u00a0\u00a0&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.9.0\/js\/anychart-base.min.js\"&gt;&lt;\/script&gt;\r\n\u00a0\u00a0&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.9.0\/js\/anychart-mekko.min.js\"&gt;&lt;\/script&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;style&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0html, body, #container {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0width: 100%;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0height: 100%;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0margin: 0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0padding: 0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0&lt;\/style&gt;\r\n\u00a0\u00a0&lt;\/head&gt;\r\n\u00a0\u00a0&lt;body&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;div id=\"container\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;script&gt;\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0anychart.onDocumentReady(function () {\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ create data\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var data = {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0title: 'Global Smartphone Shipments (In Millions) in 2019',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0header: ['Name', 'Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'],\r\n          rows: [\r\n            ['Huawei', 59.1,56.6,66.8,56.2],\r\n            ['Vivo', 23.9,27,31.3,31.5],\r\n            ['Apple', 42,36.5,44.8,72.3],\r\n            ['Samsung', 72,76.3,78.2,70.4],\r\n            ['Xiaomi', 27.8,32.3,31.7,32.9],\r\n            ['Oppo', 25.7,30.6,32.3,31.4],\r\n            ['Others', 90.5,97.7,94.9,106.4],\r\n          ]\r\n        };\r\n\r\n        \/\/ create a mekko (marimekko) chart\r\n        var chart = anychart.mekko();\r\n\r\n        \/\/ set the chart data\r\n        chart.data(data);\r\n\r\n        \/\/ enable the chart legend\r\n        chart.legend(true);\r\n\r\n        \/\/ apply a palette for coloring\r\n        chart.palette(anychart.palettes.wines);\r\n  \r\n        \/\/ customize the tooltip format\r\n        chart.tooltip().format('{%seriesName}: ${%Value}M');\r\n        \/\/ set the tooltip display mode\r\n        chart.tooltip().displayMode(\"union\");\r\n\r\n        \/\/ customize the tooltip title \r\n        var title = chart.tooltip().title();\r\n        title.fontFamily(\"Calibri\");\r\n        title.fontDecoration(\"underline\");\r\n        title.fontWeight(700);\r\n        title.fontSize(18);\r\n  \r\n        \/\/ set the chart labels settings\r\n        chart.labels().format('${%Value}M');\r\n  \r\n        \/\/ set the x-axis title\r\n        chart.xAxis().title('Smartphone Shipments by Brands');\r\n        \/\/ set the y-axis title\r\n        chart.yAxis().title('Smartphone Shipments by Quarters %');\r\n\r\n        \/\/ set the chart container id\r\n        chart.container('container');\r\n\r\n        \/\/ draw the resulting marimekko chart\r\n        chart.draw();\r\n\r\n      });\r\n\r\n\u00a0\u00a0\u00a0\u00a0&lt;\/script&gt;\r\n\u00a0\u00a0&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>Wasn&#8217;t building a Marimekko chart using JavaScript an easier task than you imagined at the beginning of the guide?\u00a0Some charting libraries&#8217; APIs like this one are easily accessible, informative, and can make your data visualization development work extremely easy. The available powerful documentation\u00a0will help you quickly sort out\u00a0any issues you may encounter while coding. Good luck!<\/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>Would you like to know how to\u00a0easily create an interactive Marimekko chart\u00a0for HTML5 based apps and Web pages using JavaScript? If yes, you are on the best path to learning this. Also known as Mekko charts\u00a0and market maps, Marimekko charts display numerical values that vary from 0% to 100% in its Y-axis. The most exciting [&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":21,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,8,23,13,279,4],"tags":[53,284,127,258,471,266,620,54,256,32,55,144,36,141,81,57,58,65,56,2227,240,2228,1860,1861,459,30,172],"class_list":["post-11873","post","type-post","status-publish","format-standard","hentry","category-anychart-charting-component","category-business-intelligence","category-html5","category-javascript","category-javascript-chart-tutorials","category-tips-and-tricks","tag-anychart","tag-chart-examples","tag-chart-types","tag-charts","tag-data-analysis","tag-data-analytics","tag-data-analytics-examples","tag-data-visualization","tag-data-visualization-examples","tag-html5","tag-html5-charts","tag-infographics","tag-javascript","tag-javascript-charting","tag-javascript-charting-library","tag-javascript-charts","tag-js-chart","tag-js-charting","tag-js-charts","tag-marimekko-chart","tag-mekko-chart","tag-mekko-graphics","tag-smartphone-data","tag-smartphone-data-visualization","tag-statistics","tag-tips-and-tricks","tag-tutorial","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Marimekko Chart Building with JavaScript Definition and Tutorial<\/title>\n<meta name=\"description\" content=\"Wanna know what a Marimekko chart is and how to build Marimekko charts\u00a0for Web pages &amp; HTML5 apps using JavaScript? Here is the best path to learning this.\" \/>\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\/2020\/12\/22\/marimekko-chart-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building Marimekko Chart with JavaScript\" \/>\n<meta property=\"og:description\" content=\"Know what a Marimekko chart is and how to build Marimekko charts\u00a0for Web pages &amp; HTML5 apps using JavaScript!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-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=\"2020-12-22T10:13:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-13T11:02:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png\" \/>\n<meta name=\"author\" content=\"Dilhani Withanage\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Building Marimekko Chart with JavaScript\" \/>\n<meta name=\"twitter:description\" content=\"Know what a Marimekko chart is and how to build Marimekko charts\u00a0for Web pages &amp; HTML5 apps using JavaScript!\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.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=\"Dilhani Withanage\" \/>\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\/2020\/12\/22\/marimekko-chart-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/\"},\"author\":{\"name\":\"Dilhani Withanage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/90e0c1bebbad8a042c97cf667f0ffc41\"},\"headline\":\"Building Marimekko Chart with JavaScript\",\"datePublished\":\"2020-12-22T10:13:47+00:00\",\"dateModified\":\"2022-08-13T11:02:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/\"},\"wordCount\":1664,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png\",\"keywords\":[\"AnyChart\",\"chart examples\",\"chart types\",\"charts\",\"data analysis\",\"data analytics\",\"data analytics examples\",\"Data Visualization\",\"data visualization examples\",\"HTML5\",\"html5 charts\",\"infographics\",\"JavaScript\",\"javascript charting\",\"JavaScript charting library\",\"javascript charts\",\"js chart\",\"js charting\",\"js charts\",\"Marimekko chart\",\"mekko chart\",\"Mekko graphics\",\"smartphone data\",\"smartphone data visualization\",\"statistics\",\"Tips and tricks\",\"tutorial\"],\"articleSection\":[\"AnyChart Charting Component\",\"Business Intelligence\",\"HTML5\",\"JavaScript\",\"JavaScript Chart Tutorials\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/\",\"name\":\"Marimekko Chart Building with JavaScript Definition and Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png\",\"datePublished\":\"2020-12-22T10:13:47+00:00\",\"dateModified\":\"2022-08-13T11:02:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/90e0c1bebbad8a042c97cf667f0ffc41\"},\"description\":\"Wanna know what a Marimekko chart is and how to build Marimekko charts\u00a0for Web pages & HTML5 apps using JavaScript? Here is the best path to learning this.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#primaryimage\",\"url\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png\",\"contentUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png\",\"width\":1100,\"height\":578},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building Marimekko Chart with JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\",\"url\":\"https:\/\/www.anychart.com\/blog\/\",\"name\":\"AnyChart News\",\"description\":\"AnyChart JS Charts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.anychart.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/90e0c1bebbad8a042c97cf667f0ffc41\",\"name\":\"Dilhani Withanage\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/35ee7b2273ffffdaea96beb03771380fac7258a4904e0c8de2b474d8f27b8962?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/35ee7b2273ffffdaea96beb03771380fac7258a4904e0c8de2b474d8f27b8962?s=96&r=g\",\"caption\":\"Dilhani Withanage\"},\"url\":\"https:\/\/www.anychart.com\/blog\/author\/dilhani_withanage\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Marimekko Chart Building with JavaScript Definition and Tutorial","description":"Wanna know what a Marimekko chart is and how to build Marimekko charts\u00a0for Web pages & HTML5 apps using JavaScript? Here is the best path to learning this.","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\/2020\/12\/22\/marimekko-chart-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Building Marimekko Chart with JavaScript","og_description":"Know what a Marimekko chart is and how to build Marimekko charts\u00a0for Web pages & HTML5 apps using JavaScript!","og_url":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2020-12-22T10:13:47+00:00","article_modified_time":"2022-08-13T11:02:47+00:00","og_image":[{"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png","type":"","width":"","height":""}],"author":"Dilhani Withanage","twitter_card":"summary_large_image","twitter_title":"Building Marimekko Chart with JavaScript","twitter_description":"Know what a Marimekko chart is and how to build Marimekko charts\u00a0for Web pages & HTML5 apps using JavaScript!","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Dilhani Withanage","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/"},"author":{"name":"Dilhani Withanage","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/90e0c1bebbad8a042c97cf667f0ffc41"},"headline":"Building Marimekko Chart with JavaScript","datePublished":"2020-12-22T10:13:47+00:00","dateModified":"2022-08-13T11:02:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/"},"wordCount":1664,"commentCount":0,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png","keywords":["AnyChart","chart examples","chart types","charts","data analysis","data analytics","data analytics examples","Data Visualization","data visualization examples","HTML5","html5 charts","infographics","JavaScript","javascript charting","JavaScript charting library","javascript charts","js chart","js charting","js charts","Marimekko chart","mekko chart","Mekko graphics","smartphone data","smartphone data visualization","statistics","Tips and tricks","tutorial"],"articleSection":["AnyChart Charting Component","Business Intelligence","HTML5","JavaScript","JavaScript Chart Tutorials","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/","url":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/","name":"Marimekko Chart Building with JavaScript Definition and Tutorial","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png","datePublished":"2020-12-22T10:13:47+00:00","dateModified":"2022-08-13T11:02:47+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/90e0c1bebbad8a042c97cf667f0ffc41"},"description":"Wanna know what a Marimekko chart is and how to build Marimekko charts\u00a0for Web pages & HTML5 apps using JavaScript? Here is the best path to learning this.","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#primaryimage","url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png","contentUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2020\/12\/marimekko-chart-js-tutorial.png","width":1100,"height":578},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2020\/12\/22\/marimekko-chart-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Building Marimekko Chart with JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/www.anychart.com\/blog\/#website","url":"https:\/\/www.anychart.com\/blog\/","name":"AnyChart News","description":"AnyChart JS Charts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.anychart.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/90e0c1bebbad8a042c97cf667f0ffc41","name":"Dilhani Withanage","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/35ee7b2273ffffdaea96beb03771380fac7258a4904e0c8de2b474d8f27b8962?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/35ee7b2273ffffdaea96beb03771380fac7258a4904e0c8de2b474d8f27b8962?s=96&r=g","caption":"Dilhani Withanage"},"url":"https:\/\/www.anychart.com\/blog\/author\/dilhani_withanage\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/11873","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\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=11873"}],"version-history":[{"count":38,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/11873\/revisions"}],"predecessor-version":[{"id":15503,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/11873\/revisions\/15503"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=11873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=11873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=11873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}