{"id":16903,"date":"2023-10-16T06:56:36","date_gmt":"2023-10-16T06:56:36","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=16903"},"modified":"2023-11-28T14:05:06","modified_gmt":"2023-11-28T14:05:06","slug":"resource-chart-javascript","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/","title":{"rendered":"How to Create Resource Chart with JavaScript"},"content":{"rendered":"<p><a href=\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/\"><img decoding=\"async\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png\" alt=\"Resource Chart\" width=\"100%\" class=\"alignnone size-full wp-image-16961\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png 1600w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart-300x188.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart-768x480.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart-1024x640.png 1024w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><\/a>In today&#8217;s data-driven world, <a href=\"https:\/\/www.anychart.com\/blog\/2018\/11\/20\/data-visualization-definition-history-examples\/\">data visualization<\/a> simplifies complex information and empowers individuals to make informed decisions. One particularly valuable <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/\">chart type<\/a> is the <strong>Resource Chart<\/strong>, which facilitates efficient resource allocation. This tutorial will be your essential guide to creating dynamic resource charts using JavaScript.<\/p>\n<p>A resource chart is a type of <a href=\"https:\/\/www.anychart.com\/blog\/2019\/09\/04\/create-gantt-chart-javascript\/\">Gantt chart<\/a> that visualizes data about resource utilization, such as equipment, employees, and so on. It provides a comprehensive overview, making it easier to make informed decisions promptly. As an illustrative example, in this tutorial, I will represent the <a href=\"https:\/\/en.wikipedia.org\/wiki\/2022_FIFA_World_Cup\" target=\"_blank\" rel=\"nofollow\">FIFA World Cup 2022 Qatar<\/a> schedule by stadium, enabling you to track when and where each game took place.<\/p>\n<p>Get your coding boots ready, and by the end of this guide, you&#8217;ll be well-equipped to create your own JS-based resource chart and have a valuable tool at your disposal for tracking your next favorite tournament, or servers status, or employee project assignments, or anything else of that kind.<\/p>\n<p><!--more Read the JS charting tutorial \u00bb--><\/p>\n<h2>Resource Chart to Be Crafted<\/h2>\n<p>Are you excited to see what we&#8217;re about to create? Keep reading, and you\u2019ll learn how to craft a JavaScript resource chart like the one showcased below.<\/p>\n<p><a href=\"https:\/\/playground.anychart.com\/nWiJAqO9\" target=\"_blank\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/resource-chart-preview.png\" alt=\"resource-chart-preview\" width=\"100%\" class=\"alignnone size-full wp-image-16962\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/resource-chart-preview.png 1156w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/resource-chart-preview-300x166.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/resource-chart-preview-768x426.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/resource-chart-preview-1024x568.png 1024w\" sizes=\"(max-width: 1156px) 100vw, 1156px\" \/><\/a><\/p>\n<p>Intrigued? Let&#8217;s kick off this thrilling journey together!<\/p>\n<h2>A. Building Resource Chart<\/h2>\n<p>The resource chart might seem like a challenging structure at first glance, with horizontal bars representing time periods. However, I assure you that it&#8217;s quite straightforward once you get the hang of it. You can construct this chart by following these four basic steps:<\/p>\n<ol>\n<li>Create a web page in HTML<\/li>\n<li>Include the necessary JavaScript files<\/li>\n<li>Load the data<\/li>\n<li>Write some JS code to visualize the resource chart<\/li>\n<\/ol>\n<p>Now, let\u2019s delve into each step in detail.<\/p>\n<h3>1. Create a web page in HTML<\/h3>\n<p>To begin, create a basic HTML page to host your JavaScript resource chart. Within the body of the HTML document, add an HTML block element such as <code>&lt;div&gt;<\/code> that will serve as the container for your upcoming chart. Give it an id which you&#8217;ll reference later in your JavaScript code when creating the chart. To ensure the chart utilizes the correct position, define some CSS rules within the <code>&lt;style&gt;<\/code> block.<\/p>\n<p>Below is an example of a simple web page created this way. I\u2019ve named the <code>&lt;div&gt;<\/code> element as \u201ccontainer\u201d and adjusted its height and width to make the chart utilize the entire screen.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\"&gt;\r\n  &lt;title&gt;JavaScript Resource Gantt Chart&lt;\/title&gt;\r\n  &lt;style type=\"text\/css\"&gt;\r\n    html,\r\n    body,\r\n    #container {\r\n      width: 100%;\r\n      height: 100%;\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n  &lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h3>2. Include the necessary JavaScript files<\/h3>\n<p>When it comes to data visualization, JavaScript charting libraries are invaluable tools. The key is to find one that not only suits your needs but also supports the specific chart type you&#8217;re looking for.<\/p>\n<p>In this tutorial, I\u2019ll use <a href=\"https:\/\/www.anychart.com\/\">AnyChart<\/a>, a long-living JS charting library that supports resource charts and provides comprehensive <a href=\"https:\/\/docs.anychart.com\/\" target=\"_blank\" rel=\"nofollow\">documentation<\/a>, and it\u2019s free (unless you integrate it into a commercial application). If you choose to use a different library, the overall process remains essentially the same.<\/p>\n<p>You have two primary options for including the necessary JavaScript files of your chosen library: downloading them and using them locally, or linking to them directly via a CDN (Content Delivery Network). In this tutorial, I\u2019ll opt for the CDN approach. Below is what it will look like when linking the required scripts in the <code>&lt;head&gt;<\/code> section of your HTML page.<\/p>\n<p>The chart&#8217;s code will find its home within the <code>&lt;script&gt;<\/code> tag in the <code>&lt;body&gt;<\/code> section. Alternatively, you can also place it in the <code>&lt;head&gt;<\/code> section if that suits your project structure better.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\"&gt;\r\n  &lt;title&gt;JavaScript Resource Gantt Chart&lt;\/title&gt;\r\n  &lt;style type=\"text\/css\"&gt;\r\n    html,\r\n    body,\r\n    #container {\r\n      width: 100%;\r\n      height: 100%;\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n  &lt;\/style&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-gantt.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n  &lt;script&gt;\r\n    \/\/ The place for the following chart\u2019s code.\r\n  &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h3>3. Load the data<\/h3>\n<p>Now, let&#8217;s load the data. In this tutorial, the schedule of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/2022_FIFA_World_Cup\" target=\"_blank\" rel=\"nofollow\">2022 FIFA World Cup<\/a> will be visualized. The data is available in JSON format on the provided <a href=\"https:\/\/gist.githubusercontent.com\/awanshrestha\/07b9144e8f2539cd192ef9a38f3ff8f5\/raw\/b4cfb7c27b48a0e92670a87b8f4b1607ca230a11\/Fifa%2520World%2520Cup%25202022%2520Qatar%2520Stadium%2520Schedule.json\" target=\"_blank\" rel=\"nofollow\">GitHub gist<\/a>.<\/p>\n<p>The data consists of a list of objects, with each object representing a stadium. Inside each stadium object, you&#8217;ll find details such as its name and city. Additionally, there is a property called &#8220;periods,&#8221; containing a list of matches that have been organized in that stadium. Each match is represented by the names of the two competing countries and the result of the match.<\/p>\n<p>To correctly feed this type of data into the resource chart, utilize the <code>anychart.data.loadJsonFile()<\/code> method. Below is the code snippet that loads the data:<\/p>\n<pre><code class=\"javascript\">anychart.data.loadJsonFile(\"https:\/\/gist.githubusercontent.com\/awanshrestha\/07b9144e8f2539cd192ef9a38f3ff8f5\/raw\/b4cfb7c27b48a0e92670a87b8f4b1607ca230a11\/Fifa%2520World%2520Cup%25202022%2520Qatar%2520Stadium%2520Schedule.json\");<\/code><\/pre>\n<h3>4. Write some JS code to visualize the resource chart<\/h3>\n<p>With the data loaded, you are now ready to move on and see how a few lines of JavaScript code can transform into a fully functional resource chart.<\/p>\n<p>Begin by adding the <code>anychart.onDocumentReady()<\/code> function, which encapsulates all the necessary code to ensure that your code executes only when the page is fully loaded.<\/p>\n<pre><code class=\"html\">&lt;script&gt;\r\n  anychart.onDocumentReady(function () {\r\n    \/\/ The resource chart data and code will be in this section.\r\n  });\r\n&lt;\/script&gt;<\/code><\/pre>\n<p>Next, load the data and create a data tree.<\/p>\n<pre><code class=\"javascript\">anychart.onDocumentReady(function () {\r\n  \/\/ load the data\r\n  anychart.data.loadJsonFile(\r\n    \"https:\/\/gist.githubusercontent.com\/awanshrestha\/07b9144e8f2539cd192ef9a38f3ff8f5\/raw\/b4cfb7c27b48a0e92670a87b8f4b1607ca230a11\/Fifa%2520World%2520Cup%25202022%2520Qatar%2520Stadium%2520Schedule.json\",\r\n    function (data) {\r\n      \/\/ create a data tree\r\n      var treeData = anychart.data.tree(data, 'as-table\u2019);\r\n    }\r\n  );\r\n});<\/code><\/pre>\n<p>Then, utilize the <code>ganttResource()<\/code> method to create the resource Gantt chart and set your data tree using the <code>data()<\/code> method.<\/p>\n<pre><code class=\"javascript\">\/\/ create a resource gantt chart\r\nvar chart = anychart.ganttResource();\r\n\r\n\/\/ set the data for the chart\r\nchart.data(treeData);<\/code><\/pre>\n<p>Place the chart within the <code>&lt;div&gt;<\/code> container introduced in Step 1, and finally, draw the chart using the <code>draw()<\/code> method.<\/p>\n<pre><code class=\"javascript\">\/\/ set the container \r\nchart.container(\"container\");\r\n\r\n\/\/ draw the chart\r\nchart.draw();<\/code><\/pre>\n<p>Voila! You&#8217;ve successfully created a simple and fully functional resource chart using JavaScript. Take a look at how it appears in action; the interactive version of this chart is available <a href=\"https:\/\/playground.anychart.com\/JyquQNUM\" target=\"_blank\" rel=\"nofollow\">here<\/a>. For your convenience, the complete code for the basic resource chart is also provided.<\/p>\n<p>With this resource chart, you can easily visualize which matches took place in which stadiums, and you can scroll through the matches section on the right to view all the matches. But there&#8217;s more to explore, so let&#8217;s proceed to customize this interactive data visualization.<\/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-JyquQNUM\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/JyquQNUM\/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-JyquQNUM{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\"&gt;\r\n  &lt;title&gt;JavaScript Resource Gantt Chart&lt;\/title&gt;\r\n  &lt;style type=\"text\/css\"&gt;\r\n    html,\r\n    body,\r\n    #container {\r\n      width: 100%;\r\n      height: 100%;\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n  &lt;\/style&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-gantt.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n  &lt;script&gt;\r\n    anychart.onDocumentReady(function () {\r\n      \/\/ load the data\r\n      anychart.data.loadJsonFile(\r\n        \"https:\/\/gist.githubusercontent.com\/awanshrestha\/07b9144e8f2539cd192ef9a38f3ff8f5\/raw\/b4cfb7c27b48a0e92670a87b8f4b1607ca230a11\/Fifa%2520World%2520Cup%25202022%2520Qatar%2520Stadium%2520Schedule.json\",\r\n        function (data) {\r\n          \/\/ create a data tree\r\n          var treeData = anychart.data.tree(data, \"as-table\");\r\n          \/\/ create a resource gantt chart\r\n          var chart = anychart.ganttResource();\r\n          \/\/ set the data for the chart\r\n          chart.data(treeData);\r\n          \/\/ set the container \r\n          chart.container(\"container\");\r\n          \/\/ draw the chart\r\n          chart.draw();\r\n        }\r\n      );\r\n    });\r\n  &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2>B. Customizing Resource Chart<\/h2>\n<p>Now that the basic JavaScript-based resource chart is in place, let&#8217;s explore ways to enhance its visuals and functionality.<\/p>\n<h3>1. Configure the rows and columns<\/h3>\n<p>To improve the visual appeal of your resource chart, let&#8217;s delve into some potential adjustments for the rows and columns.<\/p>\n<p>Firstly, you can set custom colors for the selected and hover states of rows and adjust the splitter position for better content visibility. Additionally, consider specifying a default row height for neat presentation and easy readability of row items.<\/p>\n<pre><code class=\"javascript\">\/\/ customize the rows\r\nchart\r\n  .rowSelectedFill(\"#D4DFE8\")\r\n  .rowHoverFill(\"#EAEFF3\")\r\n  .splitterPosition(230);\r\n\r\n\/\/ set the row height\r\nchart.defaultRowHeight(50);<\/code><\/pre>\n<p>Now, let&#8217;s move on to configuring the columns. In the first column, you have the option to include a simple number hashtag &#8220;#&#8221; as the title and customize its width.<\/p>\n<p>For the second column, you can make the stadium name bold to give it prominence and place the city name right below the stadium name. Tailor the column width as needed to accommodate the content comfortably.<\/p>\n<pre><code class=\"javascript\">\/\/ customize the column settings:\r\n\/\/ get the data grid\r\nvar dataGrid = chart.dataGrid();\r\n\/\/ set the fixed columns mode\r\ndataGrid.fixedColumns(true);\r\n\/\/ first column\r\ndataGrid\r\n  .column(0)\r\n  .title(\"#\")\r\n  .width(30\r\n  .labels({ hAlign: \"center\" });\r\n\/\/ second column\r\ndataGrid\r\n  .column(1)\r\n  .title(\"Stadium\")\r\n  .width(200)\r\n  .labels()\r\n  .useHtml(true)\r\n  .format(function () {\r\n    return (\r\n      \"&lt;strong&gt;\" + this.name.toString() + \"&lt;\/strong&gt; &lt;br&gt;\" + this.item.get(\"city\")\r\n    );\r\n  });<\/code><\/pre>\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-YNBXP9vL\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/YNBXP9vL\/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-YNBXP9vL{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>2. Add scores to the bars<\/h3>\n<p>Now, let&#8217;s enhance the resource chart by displaying match results directly on the timeline bars. This provides a quick overview without the need to refer elsewhere.<\/p>\n<p>To achieve this, enable labels on the periods of the timeline and apply custom styling using the <code>useHtml()<\/code> method.<\/p>\n<pre><code class=\"javascript\">\/\/ configure the period labels:\r\n\/\/ get the period labels\r\nvar periodLabels = chart.getTimeline().periods().labels();\r\n\/\/ set the period labels\r\nperiodLabels\r\n  .enabled(true)\r\n  .useHtml(true)\r\n  .format(\r\n    \"&lt;span style='color:#fff; font-size: 12px;'&gt;{%result}&lt;\/span&gt;\"\r\n  );<\/code><\/pre>\n<p>With this additional information on the resource bars themselves, the chart now delivers a richer set of information at a glance.<\/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-6DZHRrVe\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/6DZHRrVe\/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-6DZHRrVe{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>3. Personalize the visual appearance<\/h3>\n<p>For an aesthetically pleasing user experience, consider spicing up the visual aspects of the chart.<\/p>\n<p>Start by setting the background color of the chart to a light gray shade.<\/p>\n<pre><code class=\"javascript\">chart.background(\"#edeae8 0.8\");<\/code><\/pre>\n<p>Next, access the bars as elements from the timeline and make adjustments to their fill and stroke colors.<\/p>\n<pre><code>var elements = chart.getTimeline().elements();\r\nelements.normal().fill(\"#9a1032 0.8\");\r\nelements.normal().stroke(\"#212c68\");<\/code><\/pre>\n<p>To take this one level further, you can use a function to dynamically fill the color of the bars based on a condition. For example, the match result can be such a condition. So, the function checks the match result, and if it&#8217;s a tie, it paints the bar green; otherwise, it colors it red. This provides an interesting way to instantly discern the outcome of a match from the bar colors themselves.<\/p>\n<pre><code class=\"javascript\">\/\/ customize the color of the bars:\r\n\/\/ get the elements\r\nvar elements = chart.getTimeline().elements();\r\n\/\/ check if the current item is a tie, and if yes, color it differently\r\nelements.normal().fill(function() {\r\n  var result = this.period.result;\r\n  var scores = result.split(\"-\").map(Number);\r\n  if (scores[0] === scores[1]) {\r\n    return \"#11A055 0.8\";\r\n  } else {\r\n    return \"#9a1032 0.8\";\r\n  }\r\n});\r\nelements.normal().stroke(\"#212c68\");<\/code><\/pre>\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-a0d683pg\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/a0d683pg\/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-a0d683pg{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>4. Customize the tooltip<\/h3>\n<p>Now, it&#8217;s time to fine-tune the tooltip for an enhanced user experience.<\/p>\n<p>To keep the tooltip straightforward, configure it to display the team names and match results whenever you hover over a particular bar.<\/p>\n<pre><code class=\"javascript\">\/\/ configure the tooltip\r\nvar tooltip = chart.getTimeline().tooltip();\r\ntooltip\r\n  .useHtml(true)\r\n  .format(function(e) {\r\n    var tooltipText;\r\n    if (typeof e.period === \"undefined\") {\r\n      tooltipText = e.item.la.city;\r\n    } else {\r\n      var period = e.period;\r\n      tooltipText = period.result;\r\n    }\r\n    return tooltipText;\r\n  });<\/code><\/pre>\n<p>These subtle adjustments significantly improve the visual clarity of the presented data. And now, below\u2019s the final version of the resource chart. You can explore the interactive version of this final chart <a href=\"https:\/\/playground.anychart.com\/nWiJAqO9\" target=\"_blank\" rel=\"nofollow\">here<\/a>. Feel free to explore and interact with it. For your convenience, the entire code for the final resource chart is provided below.<\/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-nWiJAqO9\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/nWiJAqO9\/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-nWiJAqO9{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\"&gt;\r\n  &lt;title&gt;JavaScript Resource Gantt Chart&lt;\/title&gt;\r\n  &lt;style type=\"text\/css\"&gt;\r\n    html,\r\n    body,\r\n    #container {\r\n      width: 100%;\r\n      height: 100%;\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n  &lt;\/style&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-gantt.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n  &lt;script&gt;\r\n    anychart.onDocumentReady(function () {\r\n      \/\/ load the data\r\n      anychart.data.loadJsonFile(\r\n        \"https:\/\/gist.githubusercontent.com\/awanshrestha\/07b9144e8f2539cd192ef9a38f3ff8f5\/raw\/b4cfb7c27b48a0e92670a87b8f4b1607ca230a11\/Fifa%2520World%2520Cup%25202022%2520Qatar%2520Stadium%2520Schedule.json\",\r\n        function (data) {\r\n          \/\/ create a data tree\r\n          var treeData = anychart.data.tree(data, \"as-table\");\r\n          \/\/ create a resource gantt chart\r\n          var chart = anychart.ganttResource();\r\n          \/\/ set the data for the chart\r\n          chart.data(treeData);\r\n          \/\/ customize the rows\r\n          chart\r\n            .rowSelectedFill(\"#D4DFE8\")\r\n            .rowHoverFill(\"#EAEFF3\")\r\n            .splitterPosition(230);\r\n          \/\/ set the row height\r\n          chart.defaultRowHeight(50);\r\n          \/\/ customize the column settings:\r\n          \/\/ get the data grid\r\n          var dataGrid = chart.dataGrid();\r\n          \/\/ first column \r\n          dataGrid\r\n            .column(0)\r\n            .title(\"#\")\r\n            .width(30)\r\n            .labels({ hAlign: \"center\" });\r\n          \/\/ second column       \r\n          dataGrid\r\n            .column(1)\r\n            .title(\"Stadium\")\r\n            .width(200)\r\n            .labels()\r\n            .useHtml(true)\r\n            .format(function () {\r\n              return (\r\n               \"&lt;strong&gt;\" + this.name.toString() + \"&lt;\/strong&gt; &lt;br&gt;\" + this.item.get(\"city\")\r\n              );\r\n            });\r\n          \/\/ configure the period labels:\r\n          \/\/ get the period labels\r\n          var periodLabels = chart.getTimeline().periods().labels();\r\n          \/\/ set the period labels\r\n          periodLabels\r\n            .enabled(true)\r\n            .useHtml(true)\r\n            .format(\r\n              \"&lt;span style='color:#fff; font-size: 12px;'&gt;{%result}&lt;\/span&gt;\"\r\n            );\r\n          \/\/ configure the background of the chart\r\n          chart.background(\"#edeae8 0.8\");\r\n          \/\/ customize the color of the bars:\r\n          \/\/ get the elements\r\n          var elements = chart.getTimeline().elements();\r\n          \/\/ check if the current item is a tie, and if yes, color it differently\r\n          elements.normal().fill(function() {\r\n            var result = this.period.result;\r\n            var scores = result.split(\"-\").map(Number);\r\n            if (scores[0] === scores[1]) {\r\n              return \"#11A055 0.8\";\r\n            } else {\r\n              return \"#9a1032 0.8\";\r\n            }\r\n          });\r\n          elements.normal().stroke(\"#212c68\");\r\n          \/\/ configure the tooltip\r\n          var tooltip = chart.getTimeline().tooltip();\r\n          tooltip\r\n            .useHtml(true)\r\n            .format(function(e) {\r\n              var tooltipText;\r\n              if (typeof e.period === \"undefined\") {\r\n                tooltipText = e.item.la.city;\r\n              } else {\r\n                var period = e.period;\r\n                tooltipText = period.result;\r\n              }\r\n              return tooltipText;\r\n            });\r\n          \/\/ set the container \r\n          chart.container(\"container\");\r\n          \/\/ draw the chart\r\n          chart.draw();\r\n        }\r\n      );\r\n    });\r\n  &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>Hooray! You\u2019ve come a long way in this journey of crafting a compelling resource chart. I hope this detailed tutorial has provided you with the understanding and skills needed to create your own JavaScript resource charts.<\/p>\n<p>Now it&#8217;s your turn to explore more ways of how you can customize these charts to meet your unique requirements. Why not add some connectors or milestones, for example?<\/p>\n<p>Don&#8217;t hesitate to reach out if you&#8217;re stuck or have questions, and feel free to share the resource charts that you create following this guide. Let your creativity shine through your work!<\/p>\n<p>Happy charting.<\/p>\n<hr \/>\n<p><strong><em>Published with the permission of Awan Shrestha. Originally appeared on <a href=\"https:\/\/dzone.com\/articles\/resource-chart-js\" target=\"_blank\" rel=\"nofollow\">DZone<\/a> with the title &#8220;How To Create a Resource Chart in JavaScript&#8221; on September 27, 2023.<\/p>\n<p>You may also like to read the <a href=\"https:\/\/www.anychart.com\/blog\/2021\/08\/17\/js-resource-gantt-chart\/\">JavaScript Resource Gantt Chart Tutorial<\/a> originally published on our blog earlier, visualizing the Tokyo 2020 Paralympic schedule step by step.<\/p>\n<p>Explore other <a href=\"https:\/\/www.anychart.com\/blog\/category\/javascript-chart-tutorials\/\">JavaScript charting tutorials<\/a> and continue mastering interactive data visualization.<\/p>\n<p>Do you want to create some nice guest post for our blog, feel free to <a href=\"https:\/\/www.anychart.com\/support\/\">get in touch<\/a>.<\/strong><\/em><\/p>\n<hr \/>\n<p><!-- SyntaxHighlighter --><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/default.min.css\"><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/atom-one-light.min.css\"><script src=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/highlight.min.js\"><\/script><script>hljs.initHighlightingOnLoad();<\/script><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>In today&#8217;s data-driven world, data visualization simplifies complex information and empowers individuals to make informed decisions. One particularly valuable chart type is the Resource Chart, which facilitates efficient resource allocation. This tutorial will be your essential guide to creating dynamic resource charts using JavaScript. A resource chart is a type of Gantt chart that visualizes [&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":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,16,8,17,23,13,279,4],"tags":[619,618,53,94,3173,254,1758,3149,166,258,282,471,266,620,1292,880,806,1759,3352,509,3610,1760,2757,350,844,775,179,3369,803,2006,1220,805,2759,39,1762,2013,2014,32,55,149,1335,144,152,2949,36,907,141,249,3111,81,57,148,142,96,99,134,3586,58,65,56,101,3526,1906,230,1790,227,1788,1691,3611,1559,1558,1560,1904,228,1789,2770,2494,835,2898,172,807,808,954,3494,2015,2816,1763,804,3599,3600,1969,3406,3407,2497],"class_list":["post-16903","post","type-post","status-publish","format-standard","hentry","category-anychart-charting-component","category-anygantt","category-business-intelligence","category-gantt-chart","category-html5","category-javascript","category-javascript-chart-tutorials","category-tips-and-tricks","tag-analysis","tag-analytics","tag-anychart","tag-anygantt","tag-app-development","tag-chart","tag-chart-design","tag-chart-development","tag-charting","tag-charts","tag-data","tag-data-analysis","tag-data-analytics","tag-data-analytics-examples","tag-data-chart","tag-data-charting","tag-data-charts","tag-data-design","tag-data-graphic","tag-data-graphics","tag-data-tree","tag-data-visualization-design","tag-data-visualization-development","tag-data-visualization-projects","tag-data-visualization-tutorial","tag-dataviz-projects","tag-design","tag-developers","tag-dzone","tag-fifa","tag-football","tag-front-end-development","tag-gantt","tag-gantt-chart","tag-guest-post","tag-html","tag-html-charts","tag-html5","tag-html5-charts","tag-html5-gantt-charts","tag-infographic","tag-infographics","tag-interactive-infographic","tag-interactive-infographics","tag-javascript","tag-javascript-chart-tutorial","tag-javascript-charting","tag-javascript-charting-api","tag-javascript-charting-features","tag-javascript-charting-library","tag-javascript-charts","tag-javascript-gantt-charts","tag-javascript-graphics","tag-javascript-graphics-library","tag-javascript-library","tag-javascript-technologies","tag-js","tag-js-chart","tag-js-charting","tag-js-charts","tag-js-graphics","tag-js-library","tag-project-analytics","tag-project-chart","tag-project-gantt-chart","tag-project-management","tag-project-planning","tag-project-schedule","tag-qatar-2022","tag-resource-allocation","tag-resource-allocation-data","tag-resource-allocation-data-visualization","tag-resource-gantt-chart","tag-resource-management","tag-resource-planning","tag-resource-scheduling","tag-soccer","tag-sports","tag-sports-data-visualization","tag-tutorial","tag-visual-analysis","tag-visual-analytics","tag-visual-data-analytics","tag-web-chart","tag-web-charts","tag-web-design","tag-web-developers","tag-web-development","tag-web-page","tag-web-project","tag-web-services","tag-website","tag-website-development","tag-world-cup","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create a Resource Chart (Using JavaScript)<\/title>\n<meta name=\"description\" content=\"Learn to create interactive Resource Gantt Charts using JavaScript while visualizing the FIFA World Cup 2022 schedule step by step.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a Resource Chart (Using JavaScript)\" \/>\n<meta property=\"og:description\" content=\"Learn to create interactive Resource Gantt Charts using JavaScript while visualizing the FIFA World Cup 2022 schedule step by step.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-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=\"2023-10-16T06:56:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-28T14:05:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart-social.png\" \/>\n<meta name=\"author\" content=\"Awan Shrestha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Create a Resource Chart (Using JavaScript)\" \/>\n<meta name=\"twitter:description\" content=\"Learn to create interactive Resource Gantt Charts using JavaScript while visualizing the FIFA World Cup 2022 schedule step by step.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart-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=\"Awan Shrestha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/\"},\"author\":{\"name\":\"Awan Shrestha\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1\"},\"headline\":\"How to Create Resource Chart with JavaScript\",\"datePublished\":\"2023-10-16T06:56:36+00:00\",\"dateModified\":\"2023-11-28T14:05:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/\"},\"wordCount\":1524,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png\",\"keywords\":[\"analysis\",\"analytics\",\"AnyChart\",\"AnyGantt\",\"app development\",\"chart\",\"chart design\",\"chart development\",\"charting\",\"charts\",\"data\",\"data analysis\",\"data analytics\",\"data analytics examples\",\"data chart\",\"data charting\",\"data charts\",\"data design\",\"data graphic\",\"data graphics\",\"data tree\",\"data visualization design\",\"data visualization development\",\"data visualization projects\",\"data visualization tutorial\",\"dataviz projects\",\"design\",\"developers\",\"DZone\",\"FIFA\",\"football\",\"front-end development\",\"gantt\",\"Gantt Chart\",\"guest post\",\"HTML\",\"HTML charts\",\"HTML5\",\"html5 charts\",\"html5 gantt charts\",\"infographic\",\"infographics\",\"interactive infographic\",\"interactive infographics\",\"JavaScript\",\"javascript chart tutorial\",\"javascript charting\",\"javascript charting api\",\"JavaScript charting features\",\"JavaScript charting library\",\"javascript charts\",\"javascript gantt charts\",\"javascript graphics\",\"JavaScript graphics library\",\"JavaScript library\",\"javascript technologies\",\"js\",\"js chart\",\"js charting\",\"js charts\",\"JS graphics\",\"js library\",\"project analytics\",\"project chart\",\"project gantt chart\",\"project management\",\"project planning\",\"project schedule\",\"Qatar 2022\",\"resource allocation\",\"resource allocation data\",\"resource allocation data visualization\",\"Resource Gantt Chart\",\"resource management\",\"resource planning\",\"resource scheduling\",\"soccer\",\"sports\",\"sports data visualization\",\"tutorial\",\"visual analysis\",\"visual analytics\",\"visual data analytics\",\"web chart\",\"web charts\",\"web design\",\"web developers\",\"web development\",\"web page\",\"web project\",\"web services\",\"website\",\"website development\",\"World Cup\"],\"articleSection\":[\"AnyChart Charting Component\",\"AnyGantt\",\"Business Intelligence\",\"Gantt Chart\",\"HTML5\",\"JavaScript\",\"JavaScript Chart Tutorials\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/\",\"name\":\"How to Create a Resource Chart (Using JavaScript)\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png\",\"datePublished\":\"2023-10-16T06:56:36+00:00\",\"dateModified\":\"2023-11-28T14:05:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1\"},\"description\":\"Learn to create interactive Resource Gantt Charts using JavaScript while visualizing the FIFA World Cup 2022 schedule step by step.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#primaryimage\",\"url\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png\",\"contentUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png\",\"width\":1600,\"height\":1000},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Resource 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\/3f107fdcb3fe326a63cd52812f5287c1\",\"name\":\"Awan Shrestha\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/02ebd18c927547ca82372246dddcc3aebfa98928cb91405eef1a63ece7f17518?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/02ebd18c927547ca82372246dddcc3aebfa98928cb91405eef1a63ece7f17518?s=96&r=g\",\"caption\":\"Awan Shrestha\"},\"url\":\"https:\/\/www.anychart.com\/blog\/author\/awan-shrestha\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a Resource Chart (Using JavaScript)","description":"Learn to create interactive Resource Gantt Charts using JavaScript while visualizing the FIFA World Cup 2022 schedule step by step.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a Resource Chart (Using JavaScript)","og_description":"Learn to create interactive Resource Gantt Charts using JavaScript while visualizing the FIFA World Cup 2022 schedule step by step.","og_url":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2023-10-16T06:56:36+00:00","article_modified_time":"2023-11-28T14:05:06+00:00","og_image":[{"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart-social.png","type":"","width":"","height":""}],"author":"Awan Shrestha","twitter_card":"summary_large_image","twitter_title":"How to Create a Resource Chart (Using JavaScript)","twitter_description":"Learn to create interactive Resource Gantt Charts using JavaScript while visualizing the FIFA World Cup 2022 schedule step by step.","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart-social.png","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Awan Shrestha","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/"},"author":{"name":"Awan Shrestha","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1"},"headline":"How to Create Resource Chart with JavaScript","datePublished":"2023-10-16T06:56:36+00:00","dateModified":"2023-11-28T14:05:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/"},"wordCount":1524,"commentCount":0,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png","keywords":["analysis","analytics","AnyChart","AnyGantt","app development","chart","chart design","chart development","charting","charts","data","data analysis","data analytics","data analytics examples","data chart","data charting","data charts","data design","data graphic","data graphics","data tree","data visualization design","data visualization development","data visualization projects","data visualization tutorial","dataviz projects","design","developers","DZone","FIFA","football","front-end development","gantt","Gantt Chart","guest post","HTML","HTML charts","HTML5","html5 charts","html5 gantt charts","infographic","infographics","interactive infographic","interactive infographics","JavaScript","javascript chart tutorial","javascript charting","javascript charting api","JavaScript charting features","JavaScript charting library","javascript charts","javascript gantt charts","javascript graphics","JavaScript graphics library","JavaScript library","javascript technologies","js","js chart","js charting","js charts","JS graphics","js library","project analytics","project chart","project gantt chart","project management","project planning","project schedule","Qatar 2022","resource allocation","resource allocation data","resource allocation data visualization","Resource Gantt Chart","resource management","resource planning","resource scheduling","soccer","sports","sports data visualization","tutorial","visual analysis","visual analytics","visual data analytics","web chart","web charts","web design","web developers","web development","web page","web project","web services","website","website development","World Cup"],"articleSection":["AnyChart Charting Component","AnyGantt","Business Intelligence","Gantt Chart","HTML5","JavaScript","JavaScript Chart Tutorials","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/","url":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/","name":"How to Create a Resource Chart (Using JavaScript)","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png","datePublished":"2023-10-16T06:56:36+00:00","dateModified":"2023-11-28T14:05:06+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1"},"description":"Learn to create interactive Resource Gantt Charts using JavaScript while visualizing the FIFA World Cup 2022 schedule step by step.","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#primaryimage","url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png","contentUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/10\/javascript-resource-gantt-chart.png","width":1600,"height":1000},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2023\/10\/16\/resource-chart-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create Resource 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\/3f107fdcb3fe326a63cd52812f5287c1","name":"Awan Shrestha","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/02ebd18c927547ca82372246dddcc3aebfa98928cb91405eef1a63ece7f17518?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/02ebd18c927547ca82372246dddcc3aebfa98928cb91405eef1a63ece7f17518?s=96&r=g","caption":"Awan Shrestha"},"url":"https:\/\/www.anychart.com\/blog\/author\/awan-shrestha\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/16903","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\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=16903"}],"version-history":[{"count":19,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/16903\/revisions"}],"predecessor-version":[{"id":16968,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/16903\/revisions\/16968"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=16903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=16903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=16903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}