Google chart tools have a wide range of interactive charts and data tools.
The Google Charts script files from https://www.gstatic.com/charts/loader.js are loaded into assets/js/loader.js and this path is included in the scripts section of the angular.json file.
A google-chart.service module is added so the Google Charts script can be used by multiple charts in the app.
Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Run npm run build to build the project. The build artifacts will be stored in the docs/ directory.
๐ป Code Examples
// method using the Google Charts library with the gLib variable// create a new chart using the LineChart method, passing in the container div to show the line chart.privatedrawChart(){constdata=this.gLib.visualization.arrayToDataTable([['Year','Sales','Expenses'],['2004',1000,400],['2005',1170,460],['2006',660,1120],['2007',1030,540]]);constoptions={title: 'Company Performance',curveType: 'function',legend: {position: 'bottom'}};constchart=newthis.gLib.visualization.LineChart(document.getElementById('divLineChart'));chart.draw(data,options);}j
๐ Features
Cross-browser compatibility.
Dashboards can be used to manage multiple charts that share the same data.
Data can also be fetched from a REST API endpoint or database service call.
๐ Status & To-Do List
Status: Working & deployed to GitHub.
To-Do: Nothing
Note: App is designed for PC/tablet and does not resize well for phones - could use angular mat cards or flex-grid to make it fully responsive