Customizing the chart properties with an options object
In this recipe, we will create a new chart with Google Charts API—a candlestick chart—and we will incorporate a variety of configurations into it.
Getting ready
We will start with a clean slate by creating a fresh new JavaScript and an HTML file.
How to do it...
Most of the steps will look almost identical to the past recipes in this chapter. Our main focus will be on our options
parameters:
Create an HTML file and link it to a JavaScript file (in our case
08.04.candlestick.js
):<!DOCTYPE html> <html> <head> <title>Google Charts Getting Started</title> <meta charset="utf-8" /> <script src="https://www.google.com/jsapi"></script> <script src="./08.04.candlestick.js"></script> </head> <body style="background:#fafafa"> <div id="chart"></div> </body> </html>
In the
08.04.candlestick.js
file, add the APIload
andcallback...