Skip to content

AndrewJBateman/angular-data-dashboard

Repository files navigation

⚡ Angular Data Dashboard

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • 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.

📷 Screenshots

Example screenshot

📶 Technologies

💾 Setup

  • Run npm i to install dependencies.
  • 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.
private drawChart() {
  const data = this.gLib.visualization.arrayToDataTable([
    ['Year', 'Sales', 'Expenses'],
    ['2004',  1000,      400],
    ['2005',  1170,      460],
    ['2006',  660,       1120],
    ['2007',  1030,      540]
  ]);

  const options = {
    title: 'Company Performance',
    curveType: 'function',
    legend: { position: 'bottom' }
  };

  const chart = new this.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

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact