Skip to content

Commit

Permalink
Fixing high chart button
Browse files Browse the repository at this point in the history
  • Loading branch information
Madhuka committed Jun 30, 2015
1 parent 0db18e3 commit 5ba1a89
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
9 changes: 5 additions & 4 deletions ADDING-NEW-CHARTING-LIBRARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Need to add new JS charting library for the project or application.

This command update your bower.json and index html

##Steps
##Steps to be followed
1. Create a new factory inside the **chart-factory** with extending Global Chart Factory.

```javascript
Expand All @@ -21,14 +21,14 @@ angular.module('apacheZeppelinGsocApp').factory('MyNewChartFactory', function(
//To-Do Implement or add new chart
});
```
1.1. Supporting chart types need to define in ChartList array as below
1.1. Supporting chart types need to define in ChartList array as below
```javascript
var ChartList = {
'Bar': 'BarChart',
'Line': 'LineChart'
};
```
1.2. Develop the rest of method you need from you charting library
1.2. Develop the rest of method you need from you charting library

2. Factories are expose from **ChartService**. Therefore you can add new services (only one method) that is using new factory.

Expand All @@ -47,8 +47,9 @@ var ChartList = {
'service': 'getHighChart',
'template': 'views/charts/highchart.html'
```
Make sure you add you test cases and unit test for new chart library factory.

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

Expand Down
16 changes: 16 additions & 0 deletions app/scripts/chart-factory/high-chart-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @name apacheZeppelinGsocApp.HighChartFactory
* @description
* # Extending Gobal Chart Factory for High Chart Model
*You can find high chart api in http://api.highcharts.com/highcharts#exporting
*
*/
angular.module('apacheZeppelinGsocApp').factory('HighChartFactory', function(
Expand All @@ -15,14 +16,29 @@ angular.module('apacheZeppelinGsocApp').factory('HighChartFactory', function(
//highChart model
var HighChartChartModel = {
options: {
exporting: {
enabled: false
},
chart: {
type: 'bar'
}
},
title: {
text:''
},
subtitle: {
text:''
},
credits: {
enabled:false
},
legend:{
},
xAxis: {
categories: []
},
series: [{
name: 'populartiy',
data: []
}],
size: {
Expand Down
4 changes: 2 additions & 2 deletions app/styles/chart.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*nvd3 chart svg size fixing */
svg {
width: 550px !important;
height: 350px !important;
width: 550px !important;
height: 350px !important;
}

0 comments on commit 5ba1a89

Please sign in to comment.