ng2Charts
This Library provides two different types of d3 charts
either we can use Basic charts(ex: BarChart, LineChart etc.) by using Angular module(ChartsModule
)
or
we can use Angular 2 service (ChartService
) which exposes d34.7 module along
with Angular 2 predefined d3 functions
Import Library
Run
npm install ng2charts
Once installed
Utilizing Chart components
<bar-chart [settings]="settings" [data]="dataset"></bar-chart>
Utilizing ChartService
import Service
@ public chart: ChartService; { thischart = chartService; } const d3 = thischartd3; const line = d3 x thischart y thischart; thischart ;
for more details reference bar-chart component in src folder
to resolve d3, Install typings (add --g to install globally)
typings install --save dt~d3;