šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@coreui/angular-chartjs

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coreui/angular-chartjs

Angular wrapper component for Chart.js

2.0.0-beta.0
Source
npm
Version published
Weekly downloads
26K
-0.55%
Maintainers
1
Weekly downloads
Ā 
Created
Source

CoreUI logo

CoreUI Angular wrapper for Chart.js

Explore @coreui/angular-chartjs docs & examples Ā»

Report bug Ā· Request feature Ā· Blog

Status

npm package NPM downloads angular

install:
npm install chart.js
npm install @coreui/chartjs@3
npm install @coreui/angular-chartjs
import:
import { ChartjsModule } from '@coreui/angular-chartjs';

@NgModule({
  imports: [
      ChartjsModule,
...
usage:
@Component({
  selector: 'app-chart-sample',
  template: `<c-chart type="line" [data]="data" [options]="options" width="300"></c-chart>`,
})
export class ChartSample {

  colors = {
    label: 'My dataset',
    backgroundColor: 'rgba(77,189,116,.2)',
    borderColor: '#4dbd74',
    pointHoverBackgroundColor: '#fff',
  }

  labels = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];

  data = {
    labels: this.labels,
    datasets: [{
      data: [65, 59, 84, 84, 51, 55, 40],
      ...this.colors,
      fill:  {value: 65}
    }],
  }

  options = {
    plugins: {
      legend: {
        display: false
      }
    },
    maintainAspectRatio: false,
    elements: {
      line: {
        tension: 0.4
      },
    }
  };
}

README.png

c-chart

component

Inputs:
namedescriptiontypedefault
customTooltipsEnables custom html based tooltipsbooleantrue
dataThe data passed to Chart.js chartChartDatarequired
optionsThe options object that is passed into the Chart.js chartChartOptionsundefined
pluginsThe plugins array that is passed into the Chart.js chartPluginOptionsByTypeundefined
redrawIf true, will tear down and redraw chart on all updatesbooleanfalse
typeChart.js chart type.keyof ChartTypeRegistrybar
wrapperPut the chart into the wrapper with display: block.booleantrue
heightHeight attribute applied to the rendered canvas (px)numberundefined
widthWidth attribute applied to the rendered canvas (px)numberundefined
idHtml id attribute applied to the rendered canvasstringundefined
Outputs:
namedescription
getDatasetAtEventProxy for Chart.js getDatasetAtEvent. Calls with dataset and triggering event.
getElementAtEventProxy for Chart.js getElementAtEvent. Calls with single element array and triggering event.
getElementsAtEventProxy for Chart.js getElementsAtEvent. Calls with element array and triggering event.

See also:

FAQs

Package last updated on 22 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts