Skip to content

Commit

Permalink
adding new chart type readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Madhuka committed Jun 29, 2015
1 parent 9d732e3 commit 0db18e3
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions ADDING-NEW-CHART-TYPE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Adding New Chart Type
**Global Chart Factory** have generic chart model and each chart library have it is own factory and it is extended the Global Chart Factory. So all Supporting chart is listed can be found in it's own factory.

##Pre-request
Chart Factory is needed to define correctly.

##Steps to be followed
1. Supporting chart types need to define in ChartList array as below. You can add new hart types in there. If you need any data level transformation for chart you can define it in `Factory`.
```javascript
var ChartList = {
'Bar': 'BarChart',
'Line': 'LineChart'
};
```
1.2. Develop the rest of method you need from you charting library

2. Update the configure file for new chart type. Update 'chartTypes' as below.
```javascript
'chartTypes': ['Line', 'Bar']
```
Make sure you add same key for `ChartList` in chart library factory.

##Build, Test and Run
* `npm install` first, If you hav not run it before.
* `bower install` will download new library for application.

### Build the application

`./grunt build`

Run `grunt build` for building

### Preview Web application

`./grunt serve`

This will launch a WebApplication on port **9000** and update on code changes.

### Testing

`./grunt test`

0 comments on commit 0db18e3

Please sign in to comment.