All Projects → scttcper → ngx-chartjs

scttcper / ngx-chartjs

Licence: MIT License
Functional Chart.js wrapper for Angular

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects

Projects that are alternatives of or similar to ngx-chartjs

PiFire
PiFire is a Smart WiFi enabled controller for your pellet smoker / grill.
Stars: ✭ 41 (-18%)
Mutual labels:  chartjs
ipychart
The power of Chart.js with Python
Stars: ✭ 48 (-4%)
Mutual labels:  chartjs
covid-19-next
Offline Covid-19 stats
Stars: ✭ 17 (-66%)
Mutual labels:  chartjs
chartjs-web-components
the web components for chartjs
Stars: ✭ 50 (+0%)
Mutual labels:  chartjs
chartjs
Use Chartjs in laravel-admin
Stars: ✭ 97 (+94%)
Mutual labels:  chartjs
firefox-health-dashboard
firefox-health-dashboard.netlify.com
Stars: ✭ 26 (-48%)
Mutual labels:  chartjs
data-11ty
An open source 11ty theme designed for reporting & data-visualization
Stars: ✭ 19 (-62%)
Mutual labels:  chartjs
andresrodriguez55.github.io
Personal blog and portfolio with administration panel, notification system and comment system.
Stars: ✭ 18 (-64%)
Mutual labels:  chartjs
vuepress-theme-cool
A custom vuepress theme with mermaid and plantuml, katex and vue components.
Stars: ✭ 57 (+14%)
Mutual labels:  chartjs
chartjs-plugin-doughnutlabel
Chart.js plugin for doughnut chart to display text in the center
Stars: ✭ 48 (-4%)
Mutual labels:  chartjs
competiwatch
Web app to track and visualize your competitive match history in Overwatch.
Stars: ✭ 17 (-66%)
Mutual labels:  chartjs
vuejs-admin-dashboard-template
Mosaic Lite is a free admin dashboard template built on top of Tailwind CSS and fully coded in Vue. Made by
Stars: ✭ 139 (+178%)
Mutual labels:  chartjs
network performance monitor
Network Performance Monitor - a portable tool for troubleshooting performance issues with home networks
Stars: ✭ 74 (+48%)
Mutual labels:  chartjs
hugo-chart
a Chart.js component for Hugo. 📈
Stars: ✭ 71 (+42%)
Mutual labels:  chartjs
node-chartjs
Chart.js on the server in Node.js
Stars: ✭ 25 (-50%)
Mutual labels:  chartjs
chartjs-chart-graph
Chart.js Graph-like Charts (tree, force directed)
Stars: ✭ 103 (+106%)
Mutual labels:  chartjs
django admin chart js
An example repo showing how to add Chart.js to Django admin
Stars: ✭ 35 (-30%)
Mutual labels:  chartjs
django-chartjs-example
How to Use Chart.js with Django
Stars: ✭ 34 (-32%)
Mutual labels:  chartjs
laravel-chartjs
No description or website provided.
Stars: ✭ 13 (-74%)
Mutual labels:  chartjs
StatusPilatus
Monitor your PC like never before!
Stars: ✭ 52 (+4%)
Mutual labels:  chartjs

ngx-chartjs


npm travis codecov

Functional Chart.js wrapper for Angular

Based on react-chartjs-2

Demo: https://ngx-chartjs.vercel.app

Install

requires peer dependency js package chart.js

npm install @ctrl/ngx-chartjs chart.js

Dependencies

Latest version available for each version of Angular

@ctrl/ngx-chartjs Angular
1.1.2 6.x 7.x
2.0.0 8.x
3.0.1 9.x
4.0.2 10.x
6.0.1 11.x
current >=12.x

Use

Import and Add to module

import { ChartjsModule } from '@ctrl/ngx-chartjs';

register chartjs at root of app or module. Must run before this component mounts

import {
  BarController,
  BarElement,
  Chart,
  CategoryScale,
  LinearScale,
  Title,
  Tooltip,
  Legend,
} from 'chart.js';
// What you register will depend on what chart you are using and features used.
Chart.register(BarController, BarElement, CategoryScale, LinearScale, Title, Tooltip, Legend);

setup data and other settings

import type { ChartData, ChartOptions } from 'chart.js';
const data: ChartData = {
  labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  datasets: [
    {
      label: 'My First Dataset',
      data: [65, 59, 80, 81, 56, 55, 40],
      fill: false,
      backgroundColor: [
        'rgba(255, 99, 132, 0.2)',
        'rgba(255, 159, 64, 0.2)',
        'rgba(255, 205, 86, 0.2)',
        'rgba(75, 192, 192, 0.2)',
        'rgba(54, 162, 235, 0.2)',
        'rgba(153, 102, 255, 0.2)',
        'rgba(201, 203, 207, 0.2)',
      ],
      borderColor: [
        'rgb(255, 99, 132)',
        'rgb(255, 159, 64)',
        'rgb(255, 205, 86)',
        'rgb(75, 192, 192)',
        'rgb(54, 162, 235)',
        'rgb(153, 102, 255)',
        'rgb(201, 203, 207)',
      ],
      borderWidth: 1,
    },
  ],
};
const options: ChartOptions = {
  responsive: true,
  plugins: {
    legend: {
      position: 'top',
    },
    title: {
      display: true,
      text: 'Chart.js Doughnut Chart',
    },
  },
};

Add ngx-chartjs directive to element

<ngx-chartjs type="bar" [data]="data" [options]="options"></ngx-chartjs>

[Inputs]

name type default description
type string 'doughnut' chart.js type 'bar', 'line', etc.
data ChartData {} chart.js data object, see docs
options any {} chart.js options
redraw boolean false force redraw on any input change, like to change legend
updateMode string undefined parameter passed to chart.update()
width number 300 canvas width
height number 150 canvas height

License

MIT


GitHub @scttcper  ·  Twitter @scttcper

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].