{"id":18284,"date":"2024-11-21T12:37:50","date_gmt":"2024-11-21T12:37:50","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=18284"},"modified":"2024-11-30T14:53:03","modified_gmt":"2024-11-30T14:53:03","slug":"gantt-chart-legend","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/","title":{"rendered":"Gantt Chart Legend \u2014 JS Chart Tips"},"content":{"rendered":"<p><a href=\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18553\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png\" alt=\"A JavaScript Gantt chart with a legend, displayed with its code\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png 1336w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend-300x159.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend-768x408.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend-1024x544.png 1024w\" sizes=\"(max-width: 1336px) 100vw, 1336px\" \/><\/a><a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Legend\" target=\"_blank\" rel=\"nofollow\">Legend<\/a> is a vital element in many charts, helping viewers quickly understand what each visual component represents. However, it is not always a must-have for every <a href=\"https:\/\/www.anychart.com\/chartopedia\" target=\"_blank\">chart type<\/a>. For instance, <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/gantt-chart\/\" target=\"_blank\">Gantt charts<\/a> often work perfectly fine without a legend, so it is not enabled in our <a href=\"https:\/\/docs.anychart.com\/Gantt_Chart\" target=\"_blank\" rel=\"nofollow\">JavaScript Gantt Chart<\/a> by default. That said, creating one\u00a0is straightforward. Right now, we will show you <strong>how to add a legend to a Gantt chart<\/strong> \u2014 join us as we continue our <a href=\"https:\/\/www.anychart.com\/blog\/category\/js-chart-tips\/\">JS Chart Tips<\/a> series, sharing quick solutions inspired by real customer queries!<\/p>\n<p><!--more--><\/p>\n<h2>Question: How to Add Legend to Gantt Chart?<\/h2>\n<p>Our\u00a0<a href=\"https:\/\/www.anychart.com\/support\/\" target=\"_blank\">Support Team<\/a>\u00a0recently assisted a customer who wanted to\u00a0make a\u00a0legend for a Gantt chart. While no specific details or images were provided, our engineers assumed the request involved illustrating diverse milestone markers. They prepared a relevant example with explanations, which turned out to fully meet the customer\u2019s needs. Let us now walk you through the steps to create a similar Gantt chart legend yourself.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-18534\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-legend-sketch.png\" alt=\"A sketch showing a Gantt chart with a place for its legend above the visualization\" width=\"65%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-legend-sketch.png 1200w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-legend-sketch-300x154.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-legend-sketch-768x395.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-legend-sketch-1024x527.png 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<h2>Solution: Creating Legend for Gantt Chart<\/h2>\n<h3>Overview<\/h3>\n<p>To add a legend to your Gantt chart, use the <code>legend()<\/code>\u00a0method. You can then configure it with methods from the <a href=\"https:\/\/api.anychart.com\/v8\/anychart.core.ui.Legend\" target=\"_blank\" rel=\"nofollow\">anychart.core.ui.Legend<\/a> class, as the legend element in our\u00a0<a href=\"https:\/\/www.anychart.com\" target=\"_blank\">JavaScript charting library<\/a>\u00a0is defined as its instance.<\/p>\n<h3>In Detail<\/h3>\n<p>Assuming you have already <a href=\"https:\/\/www.anychart.com\/blog\/2019\/09\/04\/create-gantt-chart-javascript\/\" target=\"_blank\">created a Gantt chart<\/a>, here is how you can add a legend.<\/p>\n<p><strong>First<\/strong>,\u00a0enable\u00a0the legend&#8217;s display:<\/p>\n<pre><code class=\"javascript\">chart.legend().enabled(true);<\/code><\/pre>\n<p><strong>Second<\/strong>,\u00a0set the legend items using the <code>items()<\/code> method with an array of items as a parameter. Each item should\u00a0specify:<\/p>\n<ul>\n<li>The shape of the icon with <code>iconType<\/code><\/li>\n<li>The icon&#8217;s fill color with\u00a0<code>iconFill<\/code><\/li>\n<li>The label text with <code>text<\/code><\/li>\n<\/ul>\n<pre><code class=\"javascript\">chart.legend().items([\r\n  {\r\n    text: 'Meetings',\r\n    iconFill: '#64b5f6',\r\n    iconType: 'pentagon'\r\n  },\r\n  ...\r\n]);<\/code><\/pre>\n<p>That&#8217;s pretty much it! Here\u2019s the complete code\u00a0for creating such a legend using method chaining:<\/p>\n<pre><code class=\"javascript\">\/\/ Add a legend:\r\nchart.legend()\r\n  .enabled(true)\r\n  \/\/ set the legend's items\r\n  .items([\r\n    {text: 'Meetings', iconFill: '#64b5f6', iconType: 'pentagon'},\r\n    {text: 'Reviews', iconFill: '#ffd54f', iconType: 'diamond'},\r\n    {text: 'Publishing', iconFill: '#00bfa5', iconType: 'star5'},\r\n    {text: 'Other', iconFill: '#96a6a6', iconType: 'square'}\r\n  ]);<\/code><\/pre>\n<h3>Examples<\/h3>\n<p>Check out an example of a Gantt chart with a legend created following exactly the steps described above:<\/p>\n<ul>\n<li><a href=\"https:\/\/playground.anychart.com\/O0Od5hwG\" target=\"_blank\" rel=\"nofollow\">Gantt Chart with Legend | AnyChart Playground<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/playground.anychart.com\/O0Od5hwG\" target=\"_blank\" rel=\"nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18535\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend.png\" alt=\"Gantt Chart with Legend\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend.png 1200w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend-300x154.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend-768x395.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend-1024x527.png 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><br \/>\nFor situations where the legend is required inside the Gantt chart\u2019s stage, explore this example using the <a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Legend\/Standalone_Legend\" target=\"_blank\" rel=\"nofollow\">standalone legend<\/a>\u00a0mechanism:<\/p>\n<ul>\n<li><a href=\"https:\/\/playground.anychart.com\/w7JtNeQq\" target=\"_blank\" rel=\"nofollow\">Gantt Chart with Standalone Legend Within | AnyChart Playground<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/playground.anychart.com\/w7JtNeQq\" target=\"_blank\" rel=\"nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18536\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend-within.png\" alt=\"Gantt Chart with Standalone Legend Within\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend-within.png 2052w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend-within-300x156.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend-within-768x400.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-chart-with-legend-within-1024x533.png 1024w\" sizes=\"(max-width: 2052px) 100vw, 2052px\" \/><\/a><\/p>\n<h2>Further Learning<\/h2>\n<p>Learn more about adding chart legends in our JavaScript charting docs, illustrated with relevant examples:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Legend\" target=\"_blank\" rel=\"nofollow\">Legend | AnyChart JS Documentation<\/a><\/li>\n<li><a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Legend\/Standalone_Legend\" target=\"_blank\" rel=\"nofollow\">Standalone Legend | AnyChart JS Documentation<\/a><\/li>\n<\/ul>\n<h2>Wrapping Up<\/h2>\n<p>We hope this guide helps you effectively add a <a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Legend\" target=\"_blank\" rel=\"nofollow\">legend<\/a> to your Gantt chart. For advanced visualizations,\u00a0consider using the\u00a0<a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Legend\/Standalone_Legend\" target=\"_blank\" rel=\"nofollow\">standalone legend<\/a>\u00a0feature, including scenarios with <a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Legend\/Standalone_Legend#multiple_legends\" target=\"_blank\" rel=\"nofollow\">multiple legends in a single chart<\/a>\u00a0or <a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Legend\/Standalone_Legend#multiple_charts\" target=\"_blank\" rel=\"nofollow\">shared legends across multiple charts<\/a>.<\/p>\n<p>Should you have any questions or need further assistance, feel free to\u00a0contact our\u00a0<a href=\"https:\/\/www.anychart.com\/support\/\" target=\"_blank\">Support Team<\/a> via email or live chat (available throughout our website in the bottom right corner).<\/p>\n<p>Stay tuned for more insights and techniques inspired by real customer cases in our\u00a0<a href=\"https:\/\/www.anychart.com\/blog\/category\/js-chart-tips\/\" target=\"_blank\">JS Chart Tips<\/a> series, and <strong>enjoy creating interactive data visualizations with JavaScript!<\/strong><\/p>\n<p><!-- SyntaxHighlighter --><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/default.min.css\"><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/atom-one-light.min.css\"><script src=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/highlight.min.js\"><\/script><script>hljs.initHighlightingOnLoad();<\/script><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Legend is a vital element in many charts, helping viewers quickly understand what each visual component represents. However, it is not always a must-have for every chart type. For instance, Gantt charts often work perfectly fine without a legend, so it is not enabled in our JavaScript Gantt Chart by default. That said, creating one\u00a0is [&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":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,16,8,17,23,13,3780,4],"tags":[53,3840,4053,4102,3935,289,4122,254,3819,3149,284,4209,127,166,4104,3942,3971,258,4109,4110,4111,4112,2749,4113,3956,3833,4114,156,3818,4042,1292,880,806,3352,509,3845,2838,54,1760,2757,256,4121,350,4120,3032,3978,844,743,133,3369,4115,4116,4106,805,39,3820,2013,2014,32,55,149,167,4085,4084,146,433,152,2949,4090,3749,151,4089,36,3925,141,249,3111,81,3931,57,4107,3939,169,170,148,1238,142,96,99,4108,3947,3586,4054,58,3832,65,56,3929,101,3526,1937,2335,1938,4124,4208,4118,304,1790,227,4069,1788,3984,1691,1559,1558,1560,229,1904,228,1789,2770,4123,4125,3630,4210,4119,30,172,293,745,1939,4132,3494,2015,2816,1763,804,3599,3600,4131,3406,3407],"class_list":["post-18284","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-js-chart-tips","category-tips-and-tricks","tag-anychart","tag-anychart-api","tag-anychart-js-api-reference","tag-anychart-playground","tag-anychart-tutorial","tag-api","tag-appearance","tag-chart","tag-chart-customization","tag-chart-development","tag-chart-examples","tag-chart-legend","tag-chart-types","tag-charting","tag-charting-features","tag-charting-library","tag-charting-software","tag-charts","tag-code","tag-code-examples","tag-code-samples","tag-code-snippets","tag-codebase","tag-configure","tag-css","tag-custom-data-visualization","tag-customer-support","tag-customizability","tag-customization","tag-customizing-charts","tag-data-chart","tag-data-charting","tag-data-charts","tag-data-graphic","tag-data-graphics","tag-data-presentation-tips","tag-data-visualisation","tag-data-visualization","tag-data-visualization-design","tag-data-visualization-development","tag-data-visualization-examples","tag-data-visualization-library","tag-data-visualization-projects","tag-data-visualization-software","tag-data-visualization-technologies","tag-data-visualization-tools","tag-data-visualization-tutorial","tag-data-viz","tag-dataviz","tag-developers","tag-development","tag-documentation","tag-examples","tag-front-end-development","tag-gantt-chart","tag-gantt-chart-customization","tag-html","tag-html-charts","tag-html5","tag-html5-charts","tag-html5-gantt-charts","tag-interactive-charts","tag-interactive-data","tag-interactive-data-chart","tag-interactive-data-visualization","tag-interactive-graphics","tag-interactive-infographic","tag-interactive-infographics","tag-interactive-project","tag-interactive-visualization","tag-interactive-visualizations","tag-interactive-web-charts","tag-javascript","tag-javascript-chart-customization","tag-javascript-charting","tag-javascript-charting-api","tag-javascript-charting-features","tag-javascript-charting-library","tag-javascript-charting-tutorial","tag-javascript-charts","tag-javascript-code","tag-javascript-data-visualization","tag-javascript-drawing","tag-javascript-drawing-library","tag-javascript-gantt-charts","tag-javascript-graph","tag-javascript-graphics","tag-javascript-graphics-library","tag-javascript-library","tag-javascript-tutorial","tag-javascript-visualization-tutorial","tag-js","tag-js-api-reference","tag-js-chart","tag-js-chart-tips","tag-js-charting","tag-js-charts","tag-js-data-visualizations","tag-js-graphics","tag-js-library","tag-json","tag-json-charts","tag-json-data-visualization","tag-learning","tag-legend","tag-methods","tag-programming","tag-project-gantt-chart","tag-project-management","tag-project-management-tools","tag-project-planning","tag-project-planning-chart","tag-project-schedule","tag-resource-allocation","tag-resource-allocation-data","tag-resource-allocation-data-visualization","tag-resource-chart","tag-resource-gantt-chart","tag-resource-management","tag-resource-planning","tag-resource-scheduling","tag-sample-code","tag-shapes","tag-software-development","tag-standalone-legend","tag-support-team","tag-tips-and-tricks","tag-tutorial","tag-visualization","tag-visualization-techniques","tag-visualizing-json-data","tag-web-app","tag-web-chart","tag-web-charts","tag-web-design","tag-web-developers","tag-web-development","tag-web-page","tag-web-project","tag-webpage","tag-website","tag-website-development","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Gantt Chart Legend \u2014 JavaScript Chart Tips<\/title>\n<meta name=\"description\" content=\"Learn how to add a legend to a Gantt chart in JavaScript for clear milestone visualization. Check out the latest edition of JS Chart Tips!\" \/>\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\/2024\/11\/21\/gantt-chart-legend\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gantt Chart Legend | JS Chart Tips\" \/>\n<meta property=\"og:description\" content=\"Learn how to add a legend to a Gantt chart in JavaScript.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/\" \/>\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=\"2024-11-21T12:37:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-30T14:53:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend-og.png\" \/>\n<meta name=\"author\" content=\"AnyChart Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Gantt Chart Legend | JS Chart Tips\" \/>\n<meta name=\"twitter:description\" content=\"Learn how to add a legend to a Gantt chart in JavaScript\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend-x.png\" \/>\n<meta name=\"twitter:creator\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:site\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"AnyChart Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/\"},\"author\":{\"name\":\"AnyChart Team\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/2470e26e58231357db6d9993ecd6461b\"},\"headline\":\"Gantt Chart Legend \u2014 JS Chart Tips\",\"datePublished\":\"2024-11-21T12:37:50+00:00\",\"dateModified\":\"2024-11-30T14:53:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/\"},\"wordCount\":472,\"commentCount\":2,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png\",\"keywords\":[\"AnyChart\",\"AnyChart API\",\"AnyChart JS API Reference\",\"AnyChart Playground\",\"AnyChart tutorial\",\"api\",\"appearance\",\"chart\",\"chart customization\",\"chart development\",\"chart examples\",\"chart legend\",\"chart types\",\"charting\",\"charting features\",\"charting library\",\"charting software\",\"charts\",\"code\",\"code examples\",\"code samples\",\"code snippets\",\"codebase\",\"configure\",\"CSS\",\"custom data visualization\",\"customer support\",\"Customizability\",\"customization\",\"customizing charts\",\"data chart\",\"data charting\",\"data charts\",\"data graphic\",\"data graphics\",\"data presentation tips\",\"data visualisation\",\"Data Visualization\",\"data visualization design\",\"data visualization development\",\"data visualization examples\",\"data visualization library\",\"data visualization projects\",\"data visualization software\",\"data visualization technologies\",\"data visualization tools\",\"data visualization tutorial\",\"data-viz\",\"dataviz\",\"developers\",\"development\",\"documentation\",\"examples\",\"front-end development\",\"Gantt Chart\",\"Gantt chart customization\",\"HTML\",\"HTML charts\",\"HTML5\",\"html5 charts\",\"html5 gantt charts\",\"interactive charts\",\"interactive data\",\"interactive data chart\",\"interactive data visualization\",\"interactive graphics\",\"interactive infographic\",\"interactive infographics\",\"interactive project\",\"interactive visualization\",\"interactive visualizations\",\"interactive web charts\",\"JavaScript\",\"JavaScript chart customization\",\"javascript charting\",\"javascript charting api\",\"JavaScript charting features\",\"JavaScript charting library\",\"JavaScript charting tutorial\",\"javascript charts\",\"JavaScript code\",\"JavaScript data visualization\",\"javascript drawing\",\"javascript drawing library\",\"javascript gantt charts\",\"javascript graph\",\"javascript graphics\",\"JavaScript graphics library\",\"JavaScript library\",\"JavaScript tutorial\",\"JavaScript visualization tutorial\",\"js\",\"JS API Reference\",\"js chart\",\"JS chart tips\",\"js charting\",\"js charts\",\"js data visualizations\",\"JS graphics\",\"js library\",\"JSON\",\"JSON charts\",\"JSON data visualization\",\"learning\",\"legend\",\"methods\",\"programming\",\"project gantt chart\",\"project management\",\"project management tools\",\"project planning\",\"project planning chart\",\"project schedule\",\"resource allocation\",\"resource allocation data\",\"resource allocation data visualization\",\"resource chart\",\"Resource Gantt Chart\",\"resource management\",\"resource planning\",\"resource scheduling\",\"sample code\",\"shapes\",\"software development\",\"standalone legend\",\"support team\",\"Tips and tricks\",\"tutorial\",\"visualization\",\"visualization techniques\",\"visualizing JSON data\",\"web app\",\"web chart\",\"web charts\",\"web design\",\"web developers\",\"web development\",\"web page\",\"web project\",\"webpage\",\"website\",\"website development\"],\"articleSection\":[\"AnyChart Charting Component\",\"AnyGantt\",\"Business Intelligence\",\"Gantt Chart\",\"HTML5\",\"JavaScript\",\"JS Chart Tips\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/\",\"name\":\"Gantt Chart Legend \u2014 JavaScript Chart Tips\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png\",\"datePublished\":\"2024-11-21T12:37:50+00:00\",\"dateModified\":\"2024-11-30T14:53:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/2470e26e58231357db6d9993ecd6461b\"},\"description\":\"Learn how to add a legend to a Gantt chart in JavaScript for clear milestone visualization. Check out the latest edition of JS Chart Tips!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#primaryimage\",\"url\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png\",\"contentUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png\",\"width\":1336,\"height\":710},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Gantt Chart Legend \u2014 JS Chart Tips\"}]},{\"@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\/2470e26e58231357db6d9993ecd6461b\",\"name\":\"AnyChart Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4faeb24a1b553a1b071b765bfad138c00441a955b3a631c7564624ceeafdf884?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4faeb24a1b553a1b071b765bfad138c00441a955b3a631c7564624ceeafdf884?s=96&r=g\",\"caption\":\"AnyChart Team\"},\"sameAs\":[\"https:\/\/www.anychart.com\"],\"url\":\"https:\/\/www.anychart.com\/blog\/author\/andrey-khachaturov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Gantt Chart Legend \u2014 JavaScript Chart Tips","description":"Learn how to add a legend to a Gantt chart in JavaScript for clear milestone visualization. Check out the latest edition of JS Chart Tips!","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\/2024\/11\/21\/gantt-chart-legend\/","og_locale":"en_US","og_type":"article","og_title":"Gantt Chart Legend | JS Chart Tips","og_description":"Learn how to add a legend to a Gantt chart in JavaScript.","og_url":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2024-11-21T12:37:50+00:00","article_modified_time":"2024-11-30T14:53:03+00:00","og_image":[{"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend-og.png","type":"","width":"","height":""}],"author":"AnyChart Team","twitter_card":"summary_large_image","twitter_title":"Gantt Chart Legend | JS Chart Tips","twitter_description":"Learn how to add a legend to a Gantt chart in JavaScript","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend-x.png","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"AnyChart Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/"},"author":{"name":"AnyChart Team","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/2470e26e58231357db6d9993ecd6461b"},"headline":"Gantt Chart Legend \u2014 JS Chart Tips","datePublished":"2024-11-21T12:37:50+00:00","dateModified":"2024-11-30T14:53:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/"},"wordCount":472,"commentCount":2,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png","keywords":["AnyChart","AnyChart API","AnyChart JS API Reference","AnyChart Playground","AnyChart tutorial","api","appearance","chart","chart customization","chart development","chart examples","chart legend","chart types","charting","charting features","charting library","charting software","charts","code","code examples","code samples","code snippets","codebase","configure","CSS","custom data visualization","customer support","Customizability","customization","customizing charts","data chart","data charting","data charts","data graphic","data graphics","data presentation tips","data visualisation","Data Visualization","data visualization design","data visualization development","data visualization examples","data visualization library","data visualization projects","data visualization software","data visualization technologies","data visualization tools","data visualization tutorial","data-viz","dataviz","developers","development","documentation","examples","front-end development","Gantt Chart","Gantt chart customization","HTML","HTML charts","HTML5","html5 charts","html5 gantt charts","interactive charts","interactive data","interactive data chart","interactive data visualization","interactive graphics","interactive infographic","interactive infographics","interactive project","interactive visualization","interactive visualizations","interactive web charts","JavaScript","JavaScript chart customization","javascript charting","javascript charting api","JavaScript charting features","JavaScript charting library","JavaScript charting tutorial","javascript charts","JavaScript code","JavaScript data visualization","javascript drawing","javascript drawing library","javascript gantt charts","javascript graph","javascript graphics","JavaScript graphics library","JavaScript library","JavaScript tutorial","JavaScript visualization tutorial","js","JS API Reference","js chart","JS chart tips","js charting","js charts","js data visualizations","JS graphics","js library","JSON","JSON charts","JSON data visualization","learning","legend","methods","programming","project gantt chart","project management","project management tools","project planning","project planning chart","project schedule","resource allocation","resource allocation data","resource allocation data visualization","resource chart","Resource Gantt Chart","resource management","resource planning","resource scheduling","sample code","shapes","software development","standalone legend","support team","Tips and tricks","tutorial","visualization","visualization techniques","visualizing JSON data","web app","web chart","web charts","web design","web developers","web development","web page","web project","webpage","website","website development"],"articleSection":["AnyChart Charting Component","AnyGantt","Business Intelligence","Gantt Chart","HTML5","JavaScript","JS Chart Tips","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/","url":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/","name":"Gantt Chart Legend \u2014 JavaScript Chart Tips","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png","datePublished":"2024-11-21T12:37:50+00:00","dateModified":"2024-11-30T14:53:03+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/2470e26e58231357db6d9993ecd6461b"},"description":"Learn how to add a legend to a Gantt chart in JavaScript for clear milestone visualization. Check out the latest edition of JS Chart Tips!","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#primaryimage","url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png","contentUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/11\/gantt-legend.png","width":1336,"height":710},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2024\/11\/21\/gantt-chart-legend\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Gantt Chart Legend \u2014 JS Chart Tips"}]},{"@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\/2470e26e58231357db6d9993ecd6461b","name":"AnyChart Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4faeb24a1b553a1b071b765bfad138c00441a955b3a631c7564624ceeafdf884?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4faeb24a1b553a1b071b765bfad138c00441a955b3a631c7564624ceeafdf884?s=96&r=g","caption":"AnyChart Team"},"sameAs":["https:\/\/www.anychart.com"],"url":"https:\/\/www.anychart.com\/blog\/author\/andrey-khachaturov\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/18284","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\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=18284"}],"version-history":[{"count":51,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/18284\/revisions"}],"predecessor-version":[{"id":18583,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/18284\/revisions\/18583"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=18284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=18284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=18284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}