Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@coreui/angular-chartjs

Package Overview
Dependencies
Maintainers
0
Versions
115
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

  • 5.3.5
  • next
  • latest
  • v5-ng19
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

CoreUI logo

CoreUI Angular wrapper for Chart.js v4

Explore @coreui/angular-chartjs docs & examples »

Report bug · Request feature · Blog

Status

angular npm package npm package npm package
NPM downloads

install:
  • Angular CLI:
ng add @coreui/angular-chartjs
  • or npm
npm install chart.js@4
npm install @coreui/chartjs@4
npm install @coreui/angular-chartjs@5.2
import:
// ng modules
import { ChartjsModule } from '@coreui/angular-chartjs';

@NgModule({
    imports: [
        ChartjsModule,
...
// standalone components
  import { ChartjsComponent } from '@coreui/angular-chartjs';

@Component({
    imports: [
        ChartjsComponent, 
...
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:

Support CoreUI Development

CoreUI is an MIT-licensed open source project and is completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing. You can support development by buying the CoreUI PRO or by becoming a sponsor via Open Collective.

Platinum Sponsors

Support this project by becoming a Platinum Sponsor. A large company logo will be added here with a link to your website.

Gold Sponsors

Support this project by becoming a Gold Sponsor. A big company logo will be added here with a link to your website.

Silver Sponsors

Support this project by becoming a Silver Sponsor. A medium company logo will be added here with a link to your website.

Bronze Sponsors

Support this project by becoming a Bronze Sponsor. The company avatar will show up here with a link to your OpenCollective Profile.

Backers

Thanks to all the backers and sponsors! Support this project by becoming a backer.

Copyright 2024 creativeLabs Łukasz Holeczek. Code released under the MIT License. Docs released under Creative Commons.

Keywords

FAQs

Package last updated on 21 Dec 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc