SpringBot uses Angular as its client-side framework, which in turn makes use of NodeJS and yarn. Dependencies can be added to Angular project via
package.json, which is a configuration file that informs yarn what and how to install packages.
The following steps will walk through using the charting library chart.js within SpringBot.
- Open the
package.jsonfile located at
Locate the following code block and turn on the protected region by replacing
"//": [ " protected region % [Add custom dependencies here] off begin " ],
Add these lines below the code block
Your protected region should now look like the following,
"//": [ " protected region % [Add custom dependencies here] on begin " ], "chart.js": "~2.8.0", "//": [ " protected region % [Add custom dependencies here] end " ]
The supplied version number for chart.js is the most recent version at time of writing.. Your versions may vary.
- Open a new terminal and navigate to
You are now able to use chart.js in your application code.