ember-highcharts
Advanced tools
Comparing version 0.0.4 to 0.0.6
@@ -7,2 +7,3 @@ import Ember from 'ember'; | ||
content: undefined, | ||
mode: undefined, | ||
chartOptions: undefined, | ||
@@ -54,5 +55,11 @@ chart: null, | ||
draw: function() { | ||
var options; | ||
options = this.get('buildOptions'); | ||
this.set('chart', this.$().highcharts(options).highcharts()); | ||
var options, mode, $element, chart; | ||
options = [ this.get('buildOptions') ]; | ||
mode = this.get('mode'); | ||
if ( typeof mode === 'string' && !!mode) { | ||
options.unshift(mode); | ||
} | ||
$element = this.$(); | ||
chart = $element.highcharts.apply($element, options).highcharts(); | ||
this.set('chart', chart); | ||
}, | ||
@@ -59,0 +66,0 @@ |
@@ -5,4 +5,5 @@ module.exports = { | ||
afterInstall: function() { | ||
return this.addBowerPackageToProject('highcharts-release#~4.0.4'); | ||
// We expect the user to add the package he needs | ||
//return this.addBowerPackageToProject('highcharts-release#~4.0.4'); | ||
} | ||
}; |
{ | ||
"name": "ember-highcharts", | ||
"version": "0.0.4", | ||
"version": "0.0.6", | ||
"description": "A Highcharts component for ember cli", | ||
@@ -5,0 +5,0 @@ "directories": { |
@@ -7,4 +7,24 @@ # Ember-highcharts [![Build Status](https://travis-ci.org/ahmadsoe/ember-highcharts.svg)](https://travis-ci.org/ahmadsoe/ember-highcharts) [![npm version](https://badge.fury.io/js/ember-highcharts.svg)](http://badge.fury.io/js/ember-highcharts) | ||
* `ember install:addon ember-highcharts` | ||
1. Install the addon: | ||
ember install:addon ember-highcharts | ||
2. Depending on whether you want to use Highcharts, Highstock or Highmaps, install corresponding Bower package. | ||
Do **one** of the following commands: | ||
bower install --save highcharts-release | ||
bower install --save highstock-release | ||
bower install --save highmaps-release | ||
3. In your `Brocfile.js`, tell Broccoli to import the package you have just installed. | ||
Add **one** of the following lines: | ||
app.import('bower_components/highcharts-release/highcharts.src.js'); | ||
app.import('bower_components/highstock-release/highstock.src.js'); | ||
app.import('bower_components/highmaps-release/highmaps.src.js'); | ||
Depending on what Highcharts features you're gonna use, you might need to import additional files. Refer to Highcharts documentation. | ||
## Usage | ||
@@ -15,6 +35,6 @@ | ||
```handlebars | ||
{{high-charts content=chartData chartOptions=chartOptions}} | ||
{{high-charts mode=chartMode content=chartData chartOptions=chartOptions}} | ||
``` | ||
Then in a controller you can set the `chartData` and `chartOptions` values: | ||
Then in a controller you can set the `chartMode`, `chartData` and `chartOptions` values: | ||
@@ -25,2 +45,7 @@ ```javascript | ||
export default Ember.Controller.extend({ | ||
chartMode: 'StockChart', // Available options: a falsy value, 'StockChart', 'Map'. | ||
// If `mode` is not provided or is a falsy value, the chart is initialized in Charts mode. | ||
// If `mode` is a string, it is passed to Highcharts as the first argument. | ||
// When Highcharts introduces a new mode, you will be able to use it here right away. | ||
chartOptions: { | ||
@@ -42,2 +67,3 @@ chart: { | ||
}, | ||
chartData: [ | ||
@@ -74,4 +100,18 @@ { | ||
## Credit | ||
This add-on is built based on the [gist](https://gist.github.com/poteto/cd2bb47e77bf87c94d33) and [medium](https://medium.com/delightful-ui-for-ember-apps/using-highcharts-js-in-an-ember-app-18a65d611644) by [@poteto](https://github.com/poteto) | ||
## Changelog | ||
### 0.0.5 | ||
- Added an ability to use Highstock and Highmaps. | ||
- The addon no longer automatically imports the Highcharts Bower package, letting user import desired package manually. | ||
### 0.0.6 | ||
- Updated tests. | ||
- Added Highstock demo to the dummy app. |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
7184368
31
86812
113
2
1