New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ng-apexcharts

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-apexcharts

An angular implementation of ApexCharts

  • 1.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
123K
increased by2.91%
Maintainers
2
Weekly downloads
 
Created
Source

License ver

Angular wrapper for ApexCharts to build interactive visualizations in Angular.

For a demo checkout: Stackblitz example

Download and Installation

  1. Install using npm:
npm install apexcharts ng-apexcharts --save
  1. Open angular.json and under scripts add:
"scripts": [
  "node_modules/apexcharts/dist/apexcharts.min.js"
]
  1. Add ng-apexcharts-module to imports
imports: [
  BrowserModule,
  FormsModule,
  ReactiveFormsModule,
  NgApexchartsModule,
  ...
]

Usage

In any component you can use the chart using:

<apx-chart [series]="series" [chart]="chart" [title]="title"></apx-chart>

You need to provide at least the series and chart attribute to make sure the chart can get created.

You can also use any other attribute from the following options.

Options

All options of the chart can inserted using the attributes. This is a list of all available attributes:

@Input() chart: ApexChart;
@Input() annotations: ApexAnnotations;
@Input() colors: string[];
@Input() dataLabels: ApexDataLabels;
@Input() series: ApexAxisChartSeries | ApexNonAxisChartSeries;
@Input() stroke: ApexStroke;
@Input() labels: string[];
@Input() legend: ApexLegend;
@Input() fill: ApexFill;
@Input() tooltip: ApexTooltip;
@Input() plotOptions: ApexPlotOptions;
@Input() responsive: ApexResponsive[];
@Input() xaxis: ApexXAxis;
@Input() yaxis: ApexYAxis | ApexYAxis[];
@Input() grid: ApexGrid;
@Input() states: ApexStates;
@Input() title: ApexTitleSubtitle;
@Input() subtitle: ApexTitleSubtitle;
@Input() theme: ApexTheme;

You can visit the docs to read more about all the options listed above.

Auto update series

With the attribute autoUpdateSeries you can control if the chart component should call the updateSeries function automatically if the series attribute is changed. Set this attribute to false if you are using and changing the type property in your series for a mixed chart. This only has the effect that the whole chart rerenders even if only the series changes.

Use methods

For a basic usage of the charts you dont need to use the methods of the chart.

But if you want to toggle a series for example you need to call them. All methods are proxied through the component so that you dont need to access the DOM by yourself.

Just reference the component as a ViewChild in your Component by using:

@ViewChild('chartObj') chart: ChartComponent;

and changing the template to this:

<apx-chart #chartObj></apx-chart>

Now you're able to call methods from your Component.

Submitted by

Special thanks to Morris Janatzek for contributing to ApexCharts project by creating this angular wrapper.

Keywords

FAQs

Package last updated on 11 Jan 2020

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