{"id":16861,"date":"2023-09-05T12:34:35","date_gmt":"2023-09-05T12:34:35","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=16861"},"modified":"2023-09-05T14:22:20","modified_gmt":"2023-09-05T14:22:20","slug":"stock-chart-javascript","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/","title":{"rendered":"Stock Chart Creation in JavaScript: Step-by-Step Guide"},"content":{"rendered":"<p><a href=\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/\"><img decoding=\"async\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-tutorial.png\" alt=\"Stock Chart in JavaScript (HTML)\" width=\"100%\" class=\"alignnone size-full wp-image-16884\" \/><\/a>Chances are, you&#8217;ve come across various stock charts, whether you&#8217;re a seasoned trader or not. If crafting your data graphics piques your interest, you&#8217;re in the right place. Welcome to this user-friendly tutorial on building an interactive stock chart using JavaScript!<\/p>\n<p>The JS stock chart we\u2019ll create by the end of this guide will visually compare stock prices for three tech giants \u2014 Apple, Microsoft, and Google (Alphabet) \u2014 over the past decade. It\u2019s a robust example to illustrate the stock charting process and the power of market data visualization.<\/p>\n<p>So, hop on board as we explore the world of stock charts and learn how to create one from scratch.<\/p>\n<p><!--more Read the JS charting tutorial \u00bb--><\/p>\n<h2>Understanding Stock Charts<\/h2>\n<p>At its essence, a <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/stock-chart\/\">stock chart<\/a> is a visual representation that encapsulates the movements and trends in the price of financial instruments, including a listed company\u2019s stocks. These graphical tools play a pivotal role in the financial world, serving as windows into the dynamic realm of markets. Mapping out historical data points, stock charts provide valuable insights into how financial instruments have performed over a specified period.<\/p>\n<p>Offering a snapshot of price fluctuations, trading volumes, and other critical information, stock charts aid analysts, investors, and traders in making informed decisions. They facilitate the identification of patterns, trends, support and resistance levels, and potential trading opportunities.<\/p>\n<p>In the realm of financial <a href=\"https:\/\/www.anychart.com\/blog\/2018\/11\/20\/data-visualization-definition-history-examples\/\">data visualization<\/a>, stock charts serve as powerful instruments that transform raw numbers into comprehensible narratives. In the upcoming sections, we&#8217;ll leverage JavaScript to construct our very own interactive stock chart, gaining a firsthand understanding of how these visualizations come to life.<\/p>\n<h2>Stock Chart We&#8217;ll Build<\/h2>\n<p>Before we proceed, take a moment to preview the anticipated appearance of the final JS stock chart. As we embark on this journey, I&#8217;ll guide you through creating an interactive stock chart, complete with event markers, annotations, and more.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-js.png\" alt=\"JavaScript Stock Chart Preview\" width=\"100%\" class=\"alignnone size-full wp-image-16882\" \/><\/p>\n<h2>Building JS Stock Chart<\/h2>\n<p>Building a stock chart might initially appear intricate, but I&#8217;m here to demonstrate how straightforward it can be. Much like you wouldn&#8217;t want to miss the opening bell of the trading day, I encourage you to focus your attention here. We&#8217;re about to embark on the journey of crafting our own interactive JavaScript-based stock chart. So, let&#8217;s roll up our sleeves and initiate the process of bringing this type of visualization to life.<\/p>\n<h3>1. Setting up an HTML container<\/h3>\n<p>Let\u2019s start by creating an HTML container to house our stock chart. We\u2019ll set up a basic web page (feel free to use an existing one) and insert a <code>&lt;div&gt;<\/code> element with a unique ID to serve as the chart&#8217;s rendering area. Specifying the width and height of this block element as 100% will ensure the chart occupies the entire screen.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n  &lt;title&gt;Stock Chart (JS)&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\" style=\"width: 100%; height: 100%;\"&gt;&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<h3>2. Including necessary scripts<\/h3>\n<p>Next, we need to incorporate the relevant JavaScript and CSS files into the <code>&lt;head&gt;<\/code> section of the HTML page.<\/p>\n<p>For this tutorial, I am using the <a href=\"https:\/\/www.anychart.com\/\">AnyChart<\/a> library which has many cool options for <a href=\"https:\/\/www.anychart.com\/products\/anystock\">JS stock charts<\/a>, excellent ready-to-use <a href=\"https:\/\/www.anychart.com\/products\/anystock\/gallery\">stock chart examples<\/a>, and great <a href=\"https:\/\/docs.anychart.com\/Stock_Charts\" target=\"_blank\" rel=\"nofollow\">stock chart documentation<\/a> to get you started.<\/p>\n<p>For constructing a stock chart, we&#8217;ll include the Core and Stock modules. The Data Adapter module will make loading data from a file easy. The UI module along with the respective CSS file will be needed for user interface elements.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n  &lt;title&gt;Stock Chart (JS)&lt;\/title&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-stock.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;script src=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/js\/anychart\/ui.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;link href=\"https:\/\/cdn.anychart.com\/releases\/8.11.1\/css\/anychart-ui.min.css\" type=\"text\/css\" rel=\"stylesheet\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\" style=\"width: 100%; height: 100%;\"&gt;&lt;\/div&gt;\r\n    \/\/ Your chart code will go here\r\n  &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<h3>3. Preparing the data<\/h3>\n<p>Now, let\u2019s connect our data. I have already taken stock price data for the three tech companies (Apple, Microsoft, and Google (Alphabet)) from <a href=\"https:\/\/finance.yahoo.com\/\" target=\"_blank\" rel=\"nofollow\">Yahoo Finance<\/a> as three CSV data files. We\u2019ll load them using the <code>anychart.data.loadCsvFile()<\/code> function:<\/p>\n<pre><code class=\"javascript\">\/\/ for apple\r\nanychart.data.loadCsvFile(\"https:\/\/cdn.anychart.com\/csv-data\/AAPL.csv\", function (appleData) {\r\n  \/\/ for microsoft\r\n  anychart.data.loadCsvFile(\"https:\/\/cdn.anychart.com\/csv-data\/MSFT.csv\", function (msData) {\r\n    \/\/ for alphabet (google)\r\n    anychart.data.loadCsvFile(\"https:\/\/cdn.anychart.com\/csv-data\/GOOG.csv\", function (googleData) {\r\n    });\r\n  });\r\n});\r\n<\/code><\/pre>\n<h3>4. Writing the JavaScript charting code<\/h3>\n<p>Now that our foundation is set, let&#8217;s move on to writing the JavaScript code that will bring our stock chart visualization to life.<\/p>\n<p>First, we&#8217;ll encapsulate the code within the <code>anychart.onDocumentReady()<\/code> function, ensuring it executes only when the page is fully loaded.<\/p>\n<pre><code class=\"html\">&lt;script type=\"text\/javascript\"&gt;\r\n  anychart.onDocumentReady(function() {\r\n    \/\/ Your chart drawing code will go here\r\n  });\r\n&lt;\/script&gt;\r\n<\/code><\/pre>\n<p>Next, we\u2019ll add the CSV files as shown in the previous step and create three data tables, one for each tech company:<\/p>\n<pre><code class=\"javascript\">\/\/ load stock data:\r\n\/\/ for apple\r\nanychart.data.loadCsvFile(\"https:\/\/cdn.anychart.com\/csv-data\/AAPL.csv\", function (appleData) {\r\n  \/\/ for microsoft\r\n  anychart.data.loadCsvFile(\"https:\/\/cdn.anychart.com\/csv-data\/MSFT.csv\", function (msData) {\r\n    \/\/ for alphabet (google)\r\n    anychart.data.loadCsvFile(\"https:\/\/cdn.anychart.com\/csv-data\/GOOG.csv\", function (googleData) {\r\n      \/\/ create data tables:\r\n      \/\/ for apple\r\n      let appleDataTable = anychart.data.table();\r\n      appleDataTable.addData(appleData);\r\n      \/\/ for microsoft\r\n      let msftDataTable = anychart.data.table();\r\n      msftDataTable.addData(msData);\r\n      \/\/ for alphabet (google)\r\n      let googleDataTable = anychart.data.table();\r\n      googleDataTable.addData(googleData);\r\n    });\r\n  });\r\n});\r\n<\/code><\/pre>\n<p>With the data tables in place, let&#8217;s proceed to create a stock chart instance and add plots for each of the tech stocks with area series (check out the list of <a href=\"https:\/\/docs.anychart.com\/Stock_Charts\/Series\/Supported_Series\" target=\"_blank\" rel=\"nofollow\">all available stock series types<\/a>, including OHLC, candlestick, column, etc., and choose a different one if you want).<\/p>\n<p>It\u2019s essential to map the data points before rendering the chart. Stock data usually includes four values: open, high, low, and close. We\u2019ll specifically use the close value for our area graphs and map it to each series. Additionally, we&#8217;ll assign names to the series to identify each tech giant.<\/p>\n<pre><code class=\"javascript\">\/\/ create a stock chart\r\nlet chart = anychart.stock();\r\n\/\/ create three stock plots with area series:\r\n\/\/ for apple\r\nlet firstPlot = chart.plot(0);\r\nlet appleSeries = firstPlot.area(\r\n  appleDataTable.mapAs({ value: 4 })\r\n);\r\nappleSeries.name(\"AAPL\");\r\n\/\/ for microsoft\r\nlet secondPlot = chart.plot(1);\r\nlet msftSeries = secondPlot.area(\r\n  msftDataTable.mapAs({ value: 4 })\r\n);\r\nmsftSeries.name(\"MSFT\");\r\n\/\/ for alphabet (google)\r\nlet thirdPlot = chart.plot(2);\r\nlet googleSeries = thirdPlot.area(\r\n  googleDataTable.mapAs({ value: 4 })\r\n);\r\ngoogleSeries.name(\"GOOG\u201d);\r\n<\/code><\/pre>\n<p>Congratulations! We\u2019ve successfully crafted an elegant JavaScript-based stock chart that visually represents the stock price data of the three tech giants over a decade. Check it out with the complete code and feel free to experiment <a href=\"https:\/\/playground.anychart.com\/Vd0bMWpS\" target=\"_blank\" rel=\"nofollow\">here<\/a>.<\/p>\n<p><iframe sandbox=\"allow-scripts allow-pointer-lock allow-same-origin\n                 allow-popups allow-modals allow-forms\" frameBorder=\"0\" class=\"anychart-embed anychart-embed-Vd0bMWpS\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/Vd0bMWpS\/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-Vd0bMWpS{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<p>Basically, you\u2019re now equipped to build your own interactive stock charts using JavaScript. However, don\u2019t stop here\u2014this is just the starting point. Let\u2019s delve into customizing this chart further, enhancing its visual appeal with some more JS code.<\/p>\n<h2>Customizing JS Stock Chart<\/h2>\n<p>Now, let\u2019s use some helpful additional features and customization options to enhance the stock chart\u2019s appearance and functionality. We\u2019ll change the series type and combine all the series in a single plot, create a scroller series, add event markers and annotations, and enhance the chart title.<\/p>\n<h3>1. Combining the series in one plot<\/h3>\n<p>Instead of having separate <a href=\"https:\/\/docs.anychart.com\/Stock_Charts\/Chart_Plots\" target=\"_blank\" rel=\"nofollow\">plots<\/a> for each stock, combining them into one plot can provide a cleaner and more unified visualization. By doing this, we can easily compare their price movements.<\/p>\n<p>We\u2019ll represent each series as a line graph with distinct colors for better differentiation.<\/p>\n<pre><code class=\"javascript\">let plot = chart.plot(0);\r\n  plot\r\n    .line()\r\n    .name(\"AAPL\")\r\n    .data(appleDataTable.mapAs({ value: 4 }))\r\n    .stroke(\"1.5 #7CC7FF\");\r\n  plot\r\n    .line()\r\n    .name(\"MSFT\")\r\n    .data(msftDataTable.mapAs({ value: 4 }))\r\n    .stroke(\"1.5 #3498DB\");\r\n  plot\r\n    .line()\r\n    .name(\"GOOG\")\r\n    .data(googleDataTable.mapAs({ value: 4 }))\r\n    .stroke(\"1.5 #0000DD\");\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-aNBOay8P\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/1YfM88Gj\/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-aNBOay8P{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>2. Adding a scroller series<\/h3>\n<p>The <a href=\"https:\/\/docs.anychart.com\/Stock_Charts\/Scroller\" target=\"_blank\" rel=\"nofollow\">scroller<\/a> element is a valuable navigational UI control. Automatically added to all stock charts, it offers users an efficient way to explore. The scroller can accommodate a series.<\/p>\n<p>For example, let\u2019s introduce a scroller series utilizing MSFT (Microsoft) stock data.<\/p>\n<pre><code class=\"html\">chart.scroller().area(msftDataTable.mapAs({ value: 4 }));<\/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-aNBOay8P\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/lQPHXMIw\/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-aNBOay8P{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>3. Setting the date range UI<\/h3>\n<p>To enhance the stock chart\u2019s user experience and provide greater control over data exploration, let\u2019s implement <a href=\"https:\/\/docs.anychart.com\/Stock_Charts\/Range_Selection\" target=\"_blank\" rel=\"nofollow\">UI controls for date range selection<\/a>, making it easy to select specific time periods to narrow the focus to certain intervals for analysis.<\/p>\n<p>We\u2019ll add a range selector for quick period selection and a range picker that lets you input start and end dates directly. Let\u2019s also predefine a custom range that will be shown by default.<\/p>\n<pre><code class=\"javascript\">\/\/ create a date range ui:\r\n\/\/ picker\r\nlet rangePicker = anychart.ui.rangePicker();\r\nrangePicker.render(chart);\r\n\/\/ selector\r\nlet rangeSelector = anychart.ui.rangeSelector();\r\nrangeSelector.render(chart);\r\nchart.selectRange(\"2017-01-01\", \"2023-09-01\");\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-aNBOay8P\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/ukqryxjq\/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-aNBOay8P{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>4. Adding event markers<\/h3>\n<p>Now, allow me to introduce another cool enhancement for our JS stock chart. It\u2019s essential to recognize that various events can impact stock prices, and seamlessly integrating <a href=\"https:\/\/docs.anychart.com\/Stock_Charts\/Event_Markers\" target=\"_blank\" rel=\"nofollow\">event markers<\/a> into the chart can be effortlessly achieved.<\/p>\n<p>The process is simple: We\u2019ll input the event data and create markers to highlight the respective events.<\/p>\n<pre><code class=\"javascript\">\/\/ access the object\r\nlet eventMarkers = plot.eventMarkers();\r\n\/\/ set the symbol\r\nplot.eventMarkers().format(function () {\r\n  return this.getData(\"symbol\");\r\n});\r\n\/\/ set the data\r\neventMarkers.data([\r\n  {\r\n    symbol: \"1\",\r\n    date: \"2020-03-11\",\r\n    description: \"COVID-19 declared a global pandemic by the WHO\"\r\n  },\r\n  {\r\n    symbol: \"2\",\r\n    date: \"2022-02-24\",\r\n    description: \"Ukraine attacked by Russia\"\r\n  },\r\n  {\r\n    symbol: \"3\",\r\n    date: \"2022-05-10\",\r\n    description: \"Start of the 2022 crypto winter\"\r\n  }\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-aNBOay8P\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/hhisxxwM\/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-aNBOay8P{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>5. Adding annotations<\/h3>\n<p><a href=\"https:\/\/docs.anychart.com\/Stock_Charts\/Drawing_Tools_and_Annotations\" target=\"_blank\" rel=\"nofollow\">Annotations<\/a> within a stock chart are visual components strategically employed to emphasize and draw attention to particular points, trends, and more.<\/p>\n<p>For example, let\u2019s focus on showcasing the notable occurrence of record-high tech stock prices reached 20 months after the onset of the pandemic. To explore diverse annotation possibilities, take advantage of the <a href=\"https:\/\/www.anychart.com\/solutions\/drawing-tools\/\">demo<\/a>.<\/p>\n<pre><code class=\"javascript\">\/\/ access the object\r\nlet controller = plot.annotations();\r\n\/\/ create a marker annotation\r\nlet marker = controller.marker({\r\n  xAnchor: \"2021-11-11\",\r\n  valueAnchor: 368,\r\n  markerType: 'arrow-down',\r\n  size: 20,\r\n  offsetY: 0,\r\n  offsetX: 0\r\n});\r\n\/\/ create a label annotation\r\ncontroller\r\n  .label()\r\n  .xAnchor(\"2021-09-01\")\r\n  .valueAnchor(374)\r\n  .anchor(\"right-top\")\r\n  .offsetY(5)\r\n  .padding(6)\r\n  .text(\"Record-highs after 20 months of the pandemic\")\r\n  .fontColor(\"#666\")\r\n  .background({\r\n    fill: \"#fff 0.65\",\r\n    stroke: \"0.5 #c20000\",\r\n    corners: 2\r\n  }\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-aNBOay8P\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/9uE729c5\/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-aNBOay8P{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h3>6. Improving the chart title<\/h3>\n<p>To conclude, we\u2019ll elevate the stock <a href=\"https:\/\/docs.anychart.com\/Common_Settings\/Title\" target=\"_blank\" rel=\"nofollow\">chart title<\/a>. By altering the font style and incorporating a sub-title using HTML, we can achieve a more compelling visual presentation.<\/p>\n<pre><code class=\"javascript\">chart\r\n  .title()\r\n  .enabled(true)\r\n  .useHtml(true)\r\n  .text(\r\n    '&lt;span style = \"color: #111; font-size:18px; margin-bottom:15px; dy:20px\"&gt;Decade of Tech Titan Stocks&lt;\/span&gt;' +\r\n      '&lt;br\/&gt;&lt;span style=\"color:grey; font-size: 14px; margin-bottom:10px;\"&gt;Comparing &lt;span style=\"color:#7CC7FF;\"&gt;Apple&lt;\/span&gt;, &lt;span style=\"color:#3498DB;\"&gt;Microsoft&lt;\/span&gt;, and &lt;span style=\"color:#0000DD;\"&gt;Alphabet&lt;\/span&gt; stock prices from 2013 to 2023&lt;\/span&gt;'\r\n  );\r\n<\/code><\/pre>\n<p>With these enhancements in place, we\u2019ve completed the process of customizing our stock chart. Now, let\u2019s take a look at the final result of our efforts. If you\u2019re interested in accessing all the HTML, CSS, and JS code, you can find it <a href=\"https:\/\/playground.anychart.com\/aNBOay8P\" target=\"_blank\" rel=\"nofollow\">here<\/a>. Our stock chart is now not only visually engaging but also equipped with interactive features for insightful data exploration.<\/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-aNBOay8P\"\n        allowtransparency=\"true\" allowfullscreen=\"true\"\n        src=\"https:\/\/playground.anychart.com\/aNBOay8P\/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-aNBOay8P{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<h2>Conclusion<\/h2>\n<p>This tutorial has highlighted how straightforward it is to create a compelling and informative stock chart using JavaScript (HTML5). Feel free to experiment and customize it further as you like. For instance, why not display some <a href=\"https:\/\/docs.anychart.com\/Stock_Charts\/Technical_Indicators\" target=\"_blank\" rel=\"nofollow\">technical indicators<\/a> for technical analysis?<\/p>\n<p>While the stock market\u2019s trajectory may remain uncertain, mastering the art of creating interactive stock charts is undoubtedly a valuable addition to your web data visualization development skill set.<\/p>\n<p>Feel free to reach out if you have any questions. Happy stock charting!<\/p>\n<hr \/>\n<p><strong><em>We are thankful to Shachee Swadia for contributing this awesome tutorial as a guest post for our blog.<\/p>\n<p>Don\u2019t miss more <a href=\"https:\/\/www.anychart.com\/blog\/category\/javascript-chart-tutorials\/\">JavaScript charting tutorials<\/a>.<\/p>\n<p>Got an idea for a cool guest post? <a href=\"https:\/\/www.anychart.com\/support\/\">Let\u2019s make it work<\/a>!<\/em><\/strong><\/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>Chances are, you&#8217;ve come across various stock charts, whether you&#8217;re a seasoned trader or not. If crafting your data graphics piques your interest, you&#8217;re in the right place. Welcome to this user-friendly tutorial on building an interactive stock chart using JavaScript! The JS stock chart we\u2019ll create by the end of this guide will visually [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,18,263,19,23,13,279,20,4],"tags":[2285,619,618,2033,53,93,2381,72,73,3211,265,267,3219,268,3149,284,3269,1273,2012,282,471,266,620,1292,880,806,3352,509,195,107,2220,2838,54,2757,256,3377,844,165,313,1370,133,774,775,2295,1498,47,912,805,3602,1035,95,1762,913,2013,2014,32,55,2979,2016,167,146,433,151,641,36,907,141,249,3111,81,57,1238,142,96,99,3586,58,65,56,3526,911,3605,137,3603,3601,200,37,910,920,1958,1959,1960,3606,3099,3604,172,807,808,954,3100,293,899,2816,1763,804,3407,3218],"class_list":["post-16861","post","type-post","status-publish","format-standard","hentry","category-anychart-charting-component","category-anystock","category-big-data","category-financial-charts","category-html5","category-javascript","category-javascript-chart-tutorials","category-stock-charts","category-tips-and-tricks","tag-alphabet-inc","tag-analysis","tag-analytics","tag-annotations","tag-anychart","tag-anystock","tag-apple","tag-area-chart","tag-area-charts","tag-area-graph","tag-big-data","tag-big-data-applications","tag-big-data-apps","tag-big-data-tools","tag-chart-development","tag-chart-examples","tag-chart-visualizations","tag-csv","tag-csv-data-visualization","tag-data","tag-data-analysis","tag-data-analytics","tag-data-analytics-examples","tag-data-chart","tag-data-charting","tag-data-charts","tag-data-graphic","tag-data-graphics","tag-data-over-time","tag-data-tables","tag-data-visual","tag-data-visualisation","tag-data-visualization","tag-data-visualization-development","tag-data-visualization-examples","tag-data-visualization-guide","tag-data-visualization-tutorial","tag-data-visualizations","tag-data-visuals","tag-data-viz-examples","tag-dataviz","tag-dataviz-examples","tag-dataviz-projects","tag-de-telegraaf","tag-example","tag-financial-charts","tag-financial-data","tag-front-end-development","tag-goog","tag-google","tag-graphics-library","tag-guest-post","tag-historical-stock-prices","tag-html","tag-html-charts","tag-html5","tag-html5-charts","tag-information-graphics","tag-information-visualization","tag-interactive-charts","tag-interactive-data-visualization","tag-interactive-graphics","tag-interactive-visualizations","tag-investment","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-graph","tag-javascript-graphics","tag-javascript-graphics-library","tag-javascript-library","tag-js","tag-js-chart","tag-js-charting","tag-js-charts","tag-js-library","tag-js-stock-chart","tag-line-graph","tag-microsoft","tag-msft","tag-stock","tag-stock-chart","tag-stock-charts","tag-stock-data","tag-stock-exchange-data","tag-stock-market","tag-stock-market-data","tag-stock-market-data-visualization","tag-stock-plot","tag-storytelling-examples","tag-trading","tag-tutorial","tag-visual-analysis","tag-visual-analytics","tag-visual-data-analytics","tag-visual-storytelling-examples","tag-visualization","tag-visualizations","tag-web-design","tag-web-developers","tag-web-development","tag-website-development","tag-yahoo-finance","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Stock Chart Creation in JavaScript: Step-by-Step Guide<\/title>\n<meta name=\"description\" content=\"Learn to create interactive stock charts with JavaScript using real data about Apple, Microsoft, and Google stock market prices over the past decade.\" \/>\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\/09\/05\/stock-chart-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Stock Chart Creation in JavaScript: Step-by-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Learn to create interactive stock charts with JavaScript using real data about Apple, Microsoft, and Google stock market prices over the past decade.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-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-09-05T12:34:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-05T14:22:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-tutorial-og.png\" \/>\n<meta name=\"author\" content=\"Shachee Swadia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Stock Chart Creation in JavaScript: Step-by-Step Guide\" \/>\n<meta name=\"twitter:description\" content=\"Learn to create interactive stock charts with JavaScript using real data about Apple, Microsoft, and Google stock market prices over the past decade.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-tutorial-og.png\" \/>\n<meta name=\"twitter:creator\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:site\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Shachee Swadia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 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\/09\/05\/stock-chart-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/\"},\"author\":{\"name\":\"Shachee Swadia\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51\"},\"headline\":\"Stock Chart Creation in JavaScript: Step-by-Step Guide\",\"datePublished\":\"2023-09-05T12:34:35+00:00\",\"dateModified\":\"2023-09-05T14:22:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/\"},\"wordCount\":1425,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-tutorial.png\",\"keywords\":[\"Alphabet Inc.\",\"analysis\",\"analytics\",\"annotations\",\"AnyChart\",\"AnyStock\",\"Apple\",\"area chart\",\"area charts\",\"area graph\",\"big data\",\"big data applications\",\"big data apps\",\"big data tools\",\"chart development\",\"chart examples\",\"chart visualizations\",\"CSV\",\"CSV data visualization\",\"data\",\"data analysis\",\"data analytics\",\"data analytics examples\",\"data chart\",\"data charting\",\"data charts\",\"data graphic\",\"data graphics\",\"data over time\",\"data tables\",\"data visual\",\"data visualisation\",\"Data Visualization\",\"data visualization development\",\"data visualization examples\",\"data visualization guide\",\"data visualization tutorial\",\"data visualizations\",\"data visuals\",\"data viz examples\",\"dataviz\",\"dataviz examples\",\"dataviz projects\",\"De Telegraaf\",\"example\",\"Financial charts\",\"financial data\",\"front-end development\",\"GOOG\",\"Google\",\"graphics library\",\"guest post\",\"historical stock prices\",\"HTML\",\"HTML charts\",\"HTML5\",\"html5 charts\",\"information graphics\",\"information visualization\",\"interactive charts\",\"interactive data visualization\",\"interactive graphics\",\"interactive visualizations\",\"investment\",\"JavaScript\",\"javascript chart tutorial\",\"javascript charting\",\"javascript charting api\",\"JavaScript charting features\",\"JavaScript charting library\",\"javascript charts\",\"javascript graph\",\"javascript graphics\",\"JavaScript graphics library\",\"JavaScript library\",\"js\",\"js chart\",\"js charting\",\"js charts\",\"js library\",\"JS stock chart\",\"line graph\",\"microsoft\",\"MSFT\",\"stock\",\"stock chart\",\"Stock charts\",\"stock data\",\"stock exchange data\",\"stock market\",\"stock market data\",\"stock market data visualization\",\"stock plot\",\"storytelling examples\",\"trading\",\"tutorial\",\"visual analysis\",\"visual analytics\",\"visual data analytics\",\"visual storytelling examples\",\"visualization\",\"visualizations\",\"web design\",\"web developers\",\"web development\",\"website development\",\"Yahoo Finance\"],\"articleSection\":[\"AnyChart Charting Component\",\"AnyStock\",\"Big Data\",\"Financial Charts\",\"HTML5\",\"JavaScript\",\"JavaScript Chart Tutorials\",\"Stock Charts\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/\",\"name\":\"Stock Chart Creation in JavaScript: Step-by-Step Guide\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-tutorial.png\",\"datePublished\":\"2023-09-05T12:34:35+00:00\",\"dateModified\":\"2023-09-05T14:22:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51\"},\"description\":\"Learn to create interactive stock charts with JavaScript using real data about Apple, Microsoft, and Google stock market prices over the past decade.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Stock Chart Creation in JavaScript: Step-by-Step Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\",\"url\":\"https:\/\/www.anychart.com\/blog\/\",\"name\":\"AnyChart News\",\"description\":\"AnyChart JS Charts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.anychart.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51\",\"name\":\"Shachee Swadia\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/50ebd5c61e4e46e052898a5ddbcef5996666132cf07c614be4725f028ec7eae3?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/50ebd5c61e4e46e052898a5ddbcef5996666132cf07c614be4725f028ec7eae3?s=96&r=g\",\"caption\":\"Shachee Swadia\"},\"url\":\"https:\/\/www.anychart.com\/blog\/author\/shachee-swadia\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Stock Chart Creation in JavaScript: Step-by-Step Guide","description":"Learn to create interactive stock charts with JavaScript using real data about Apple, Microsoft, and Google stock market prices over the past decade.","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\/09\/05\/stock-chart-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Stock Chart Creation in JavaScript: Step-by-Step Guide","og_description":"Learn to create interactive stock charts with JavaScript using real data about Apple, Microsoft, and Google stock market prices over the past decade.","og_url":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2023-09-05T12:34:35+00:00","article_modified_time":"2023-09-05T14:22:20+00:00","og_image":[{"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-tutorial-og.png","type":"","width":"","height":""}],"author":"Shachee Swadia","twitter_card":"summary_large_image","twitter_title":"Stock Chart Creation in JavaScript: Step-by-Step Guide","twitter_description":"Learn to create interactive stock charts with JavaScript using real data about Apple, Microsoft, and Google stock market prices over the past decade.","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-tutorial-og.png","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Shachee Swadia","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/"},"author":{"name":"Shachee Swadia","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51"},"headline":"Stock Chart Creation in JavaScript: Step-by-Step Guide","datePublished":"2023-09-05T12:34:35+00:00","dateModified":"2023-09-05T14:22:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/"},"wordCount":1425,"commentCount":0,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-tutorial.png","keywords":["Alphabet Inc.","analysis","analytics","annotations","AnyChart","AnyStock","Apple","area chart","area charts","area graph","big data","big data applications","big data apps","big data tools","chart development","chart examples","chart visualizations","CSV","CSV data visualization","data","data analysis","data analytics","data analytics examples","data chart","data charting","data charts","data graphic","data graphics","data over time","data tables","data visual","data visualisation","Data Visualization","data visualization development","data visualization examples","data visualization guide","data visualization tutorial","data visualizations","data visuals","data viz examples","dataviz","dataviz examples","dataviz projects","De Telegraaf","example","Financial charts","financial data","front-end development","GOOG","Google","graphics library","guest post","historical stock prices","HTML","HTML charts","HTML5","html5 charts","information graphics","information visualization","interactive charts","interactive data visualization","interactive graphics","interactive visualizations","investment","JavaScript","javascript chart tutorial","javascript charting","javascript charting api","JavaScript charting features","JavaScript charting library","javascript charts","javascript graph","javascript graphics","JavaScript graphics library","JavaScript library","js","js chart","js charting","js charts","js library","JS stock chart","line graph","microsoft","MSFT","stock","stock chart","Stock charts","stock data","stock exchange data","stock market","stock market data","stock market data visualization","stock plot","storytelling examples","trading","tutorial","visual analysis","visual analytics","visual data analytics","visual storytelling examples","visualization","visualizations","web design","web developers","web development","website development","Yahoo Finance"],"articleSection":["AnyChart Charting Component","AnyStock","Big Data","Financial Charts","HTML5","JavaScript","JavaScript Chart Tutorials","Stock Charts","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/","url":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/","name":"Stock Chart Creation in JavaScript: Step-by-Step Guide","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/09\/stock-chart-tutorial.png","datePublished":"2023-09-05T12:34:35+00:00","dateModified":"2023-09-05T14:22:20+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51"},"description":"Learn to create interactive stock charts with JavaScript using real data about Apple, Microsoft, and Google stock market prices over the past decade.","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2023\/09\/05\/stock-chart-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Stock Chart Creation in JavaScript: Step-by-Step Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.anychart.com\/blog\/#website","url":"https:\/\/www.anychart.com\/blog\/","name":"AnyChart News","description":"AnyChart JS Charts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.anychart.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/273255f98371177b5ac1f4775610bb51","name":"Shachee Swadia","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/50ebd5c61e4e46e052898a5ddbcef5996666132cf07c614be4725f028ec7eae3?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/50ebd5c61e4e46e052898a5ddbcef5996666132cf07c614be4725f028ec7eae3?s=96&r=g","caption":"Shachee Swadia"},"url":"https:\/\/www.anychart.com\/blog\/author\/shachee-swadia\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/16861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=16861"}],"version-history":[{"count":29,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/16861\/revisions"}],"predecessor-version":[{"id":16896,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/16861\/revisions\/16896"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=16861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=16861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=16861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}