angular2-chartjs
Advanced tools
Comparing version 0.1.4 to 0.1.5
# Change Log | ||
## v0.1.5 / 2016-10-24 | ||
### Added | ||
- exposed chart instance. | ||
## v0.1.4 / 2016-10-13 | ||
@@ -4,0 +8,0 @@ ### Fixed |
@@ -1,2 +0,3 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Component, OnInit, ViewChild } from '@angular/core'; | ||
import { ChartComponent } from '../src'; | ||
@@ -8,3 +9,5 @@ @Component({ | ||
export class AppComponent { | ||
type = 'line' | ||
@ViewChild(ChartComponent) chartComponent: ChartComponent; | ||
type = 'line'; | ||
data = { | ||
@@ -18,7 +21,7 @@ labels: ["January", "February", "March", "April", "May", "June", "July"], | ||
] | ||
} | ||
}; | ||
options = { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} | ||
}; | ||
@@ -25,0 +28,0 @@ constructor() { |
import { ElementRef, OnInit, OnChanges, SimpleChanges } from '@angular/core'; | ||
export declare class ChartComponent implements OnInit, OnChanges { | ||
private elementRef; | ||
private chart; | ||
chart: any; | ||
type: string; | ||
@@ -6,0 +6,0 @@ data: any; |
{ | ||
"name": "angular2-chartjs", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Chart.js component for Angular2", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -26,3 +26,3 @@ # angular2-chartjs | ||
```JavaScript | ||
type = 'line' | ||
type = 'line'; | ||
data = { | ||
@@ -36,7 +36,7 @@ labels: ["January", "February", "March", "April", "May", "June", "July"], | ||
] | ||
} | ||
}; | ||
options = { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} | ||
}; | ||
``` | ||
@@ -48,2 +48,25 @@ HTML | ||
## Options | ||
### [type] | ||
*string*, required | ||
Chart type. | ||
### [data] | ||
*object*, required | ||
To display data, the chart must be passed a data object that contains all of the information needed by the chart. [See](http://www.chartjs.org/docs/#chart-configuration-chart-data). | ||
### [options] | ||
*object*, optional | ||
To create a chart with configuration options, simply pass an object containing your configuration to the constructor. [See](http://www.chartjs.org/docs/#chart-configuration-creating-a-chart-with-options). | ||
## Members | ||
### chart | ||
*Chart* | ||
Chart instance. You can call Chart.js methods via this member. | ||
Example: | ||
```JavaScript | ||
chartComponent.chart.destroy(); | ||
``` | ||
## SystemJs | ||
@@ -50,0 +73,0 @@ Add following settings |
@@ -9,3 +9,3 @@ import { Component, Input, ElementRef, OnInit, OnChanges, SimpleChanges } from '@angular/core'; | ||
export class ChartComponent implements OnInit, OnChanges { | ||
private chart: any; | ||
chart: any; | ||
@@ -12,0 +12,0 @@ @Input() type: string; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14878
258
92