Skip to content

Commit 323830a

Browse files
authored
Update README.md
proofread 99% ready
1 parent 48f0455 commit 323830a

File tree

1 file changed

+64
-74
lines changed

1 file changed

+64
-74
lines changed

README.md

Lines changed: 64 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ AngularJS v1.x directives for AnyChart
44

55
=========
66

7-
AngularJS v1.x directives for AnyChart provide and easy way to use [AnyChart JavaScript Charts](http://anychart.com)
7+
AngularJS v1.x directives for AnyChart provide an easy way to use [AnyChart JavaScript Charts](http://anychart.com)
88
with [AngularJS Framework](https://angularjs.org/).
99

1010
## Table of Contents
1111

1212
* [Download and install](#download-and-install)
1313
* [Quick start](#quick-start)
1414
* [AnychartService](#anychartservice)
15-
* [Available directives](#available-directives)
16-
* [Demos overview](#demos-overview)
15+
* [Available Directives](#available-directives)
16+
* [Demos Overview](#demos-overview)
1717
* [Contacts](#contacts)
1818
* [Links](#links)
1919
* [License](#license)
@@ -30,7 +30,7 @@ You can install AngularJS-plugin using **npm**, **bower** or **yarn**:
3030

3131
#### Direct download
3232

33-
You can download AngularJS-plugin directly from the [dist](https://github.com/AnyChart/AnyChart-AngularJS/tree/master/dist) folder.
33+
You can download AngularJS plugin directly from the [dist](https://github.com/AnyChart/AnyChart-AngularJS/tree/master/dist) folder.
3434

3535
## Quick start
3636

@@ -108,7 +108,7 @@ AnychartService is an [Angular Service](https://docs.angularjs.org/guide/service
108108
By default, AnychartService, as a shareable object, contains two fields:
109109
* `AnychartService.charts` - an array that contains chart instances for
110110
dashboarding purposes.
111-
* `AnychartService.chart` - current chart. Auto- or manually- created.
111+
* `AnychartService.chart` - current chart. Auto or manually created.
112112
It is useful for any deferred actions like async data loading.
113113

114114
```javascript
@@ -117,37 +117,37 @@ angular
117117
.controller('MyCtrl', ['$scope', '$http', 'AnychartService', function($scope, $http, AnychartService) {
118118
var service = AnychartService;
119119
$http.get('sample1.json').then(function(response) {
120-
if (service.chart) // If a chart has been successfully instantiated.
120+
if (service.chart) // If a chart is successfully instantiated.
121121
service.chart.data(response.data);
122122
});
123123
}]);
124124
```
125125

126126

127-
## Available directives
127+
## Available Directives
128128

129129
Directive | Code sample | Description
130130
--- | --- | ---
131-
anychart | `<div anychart></div>` | Supports attributes specific to this directive and generates a chart belonging to anychart module (not gantt, map or stock chart types)
132-
anygantt | `<div anygantt></div>` | Supports specific attributes and generates a chart belonging to anygantt module (`ganttResource` and `ganttProject`)
133-
anymap | `<div anymap></div>` | Supports specific attributes and generates a chart with map-specific series (`choropleth`, `bubbleMap`, etc.).
134-
anystock | `<div anystock></div>` | Supports specific attributes and generates a Stock-Chart.
135-
anychart-stage | `<div anychart-stage></div>` | Generates anychart [stage](http://docs.anychart.com/7.12.0/Dashboards/Stage-Based_Layout) to provide any kind of custom drawing (including dashboards)
131+
anychart | `<div anychart></div>` | Supports attributes specific to this directive and generates a chart from anychart module (not gantt, map or stock chart types)
132+
anygantt | `<div anygantt></div>` | Supports attributes specific to this directive and generates a chart from anygantt module (`ganttResource` and `ganttProject`)
133+
anymap | `<div anymap></div>` |Supports attributes specific to this directive and generates a chart from anymap module (`choropleth`, `bubbleMap`, etc.).
134+
anystock | `<div anystock></div>` | Supports attributes specific to this directive and generates a chart from anystock module (`anychart.stock`).
135+
anychart-stage | `<div anychart-stage></div>` | Generates anychart [stage](http://docs.anychart.com/latest/Dashboards/Stage-Based_Layout) to deal with complex charts and any kind of custom drawing.
136136

137137

138-
#### `anychart`-directive attributes
139-
We use this directive to deal with charts included in anychart-module.
138+
#### `anychart` directive attributes
139+
This directive is used to work with charts from anychart module.
140140

141141
Attribute | View Sample | Controller Sample | Description
142142
--- | --- | --- | ---
143-
ac-type | `<div anychart ac-type="line"></div>` | - | Literally means what kind of simple chart will be created. In current sample, `anychart.line()`-constructor will be called.
144-
ac-data | `<div anychart ac-data="myData"></div>` | `$scope.myData = [ ... ];`| This means that data must be put into a `$scope` of your controller in a field named `myData`. This value becomes a data source for chart. Please note, that for `anychart` directive we set the data with `chart.data()`-method. If chart doesn't have this method, then just use `ac-instance` directive instead (described below).
143+
ac-type | `<div anychart ac-type="line"></div>` | - | Kind of chart to create. In a sample, `anychart.line()` constructor is called.
144+
ac-data | `<div anychart ac-data="myData"></div>` | `$scope.myData = [ ... ];`| Data to be put into a `$scope` of your controller in a field named `myData`. This value is a data source for a chart. Please note that for `anychart` directive we set the data with `chart.data()`-method. If chart doesn't have this method, use `ac-instance` directive instead (described below).
145145
ac-title | `<div anychart ac-title="My Custom Title"></div>` | - | Sets a string value to a chart title.
146-
ac-legend | `<div anychart ac-legend="true"></div>` | - | Takes a string representation of boolean flag. Literally means whether to enable or disable the legend.
147-
ac-instance | `<div anychart ac-instance="myChart"></div>` | `$scope.myChart = chart;` | It means that we create a chart instance in our controller manually and want to use it instead of auto-created. In this case we can configure a chart using [Anychart API](https://api.anychart.com/) and access the settings not available via these `ac`-attributes. To make it work, just create an instance manually, configure it and put into a `$scope` in specified field.
148-
ac-chart-draw | `<div anychart ac-chart-draw="afterDrawHandler"></div>` | `$scope.afterDrawHandler = function(chart) { ... };` | Function called after the chart if drawn. Takes as argument that chart itself.
146+
ac-legend | `<div anychart ac-legend="true"></div>` | - | A string representation of a boolean flag. Enables/disables a legend.
147+
ac-instance | `<div anychart ac-instance="myChart"></div>` | `$scope.myChart = chart;` | Chart instance is created in a controller manually and it is used instead of auto-created. In this case a chart can be configired using [Anychart API](https://api.anychart.com/) and access to the settings is not available via these `ac`-attributes. To make it work, create an instance manually, configure it and put into a `$scope` in specified field.
148+
ac-chart-draw | `<div anychart ac-chart-draw="afterDrawHandler"></div>` | `$scope.afterDrawHandler = function(chart) { ... };` | Function called after the chart is drawn. Takes a chart itself as and argument.
149149

150-
**Please note:** Here's no need to set a container of chart and call `chart.draw()`. This integration makes if automatically.
150+
**Please note:** No need to set a container of a chart and call `chart.draw()`. The plugin does it automatically.
151151

152152
#### Sample:
153153
```html
@@ -172,17 +172,14 @@ angular
172172
```
173173

174174

175-
#### `anychart-stage`-directive attributes
176-
We use this directive to deal with anychart stage for custom drawing
177-
and dashboarding purposes.
175+
#### `anychart-stage` directive attributes
176+
This directive is used to draw anychart stage for custom drawing and complex charts.
178177

179178
Attribute | View Sample | Controller Sample | Description
180179
--- | --- | --- | ---
181-
ac-instance | `<div anychart-stage ac-instance="myStage"></div>` | `$scope.myStage = stage;` | It means that we create a stage instance in our controller manually and want to use it instead of auto-created. In this case we can configure a stage using [Anychart API](https://api.anychart.com/) and access the settings not available via these `ac`-attributes. To make it work, just create an instance manually, configure it and put into a `$scope` in specified field.
180+
ac-instance | `<div anychart-stage ac-instance="myStage"></div>` | `$scope.myStage = stage;` | A stage instances is created in a controller manually and it is used instead of auto-created. In this case a stage is configured using [Anychart API](https://api.anychart.com/) and access to the settings is not available via these `ac`-attributes. To make it work, create an instance manually, configure it and put into a `$scope` into a specified field.
182181

183-
184-
We already know about AnychartService, well we can use it to deal with
185-
anychart-stage for dashboarding purposes. Take a look on this sample:
182+
[AnychartService](#anychartservice) can be used it to deal with anychart stage. Take a look at this sample:
186183

187184
```javascript
188185
angular
@@ -218,75 +215,68 @@ angular
218215

219216
}]);
220217
```
221-
What's going on here?
222-
* We create instances of `anychart.pie` and `anychart.line`.
223-
* We configure it (data, bounds, title).
224-
* We put it in `AnychartService.charts`. Please, note that we wrap `pie`-chart
225-
with object with one more additional field `chartDraw`. Here `chartDraw` is
226-
just a function that will be called after `pie`-chart is drawn with a single argument
227-
that is `pie`-chart itself.
228-
* Controller of `anychart-stage`-directive will process an `AnychartService.charts`-array
229-
itself.
218+
219+
This is what happens in the sample above:
220+
* Instances of `anychart.pie` and `anychart.line` are created.
221+
* Data, bounds, title and so one are configured.
222+
* Charts art put into `AnychartService.charts`. Note that we wrap `pie`-chart
223+
into an object with one additional field:: `chartDraw`. `chartDraw` is
224+
a function that is called after `pie` chart is drawn with a single argument
225+
that is `pie` chart itself.
226+
* Controller of `anychart-stage` directive processes the `AnychartService.charts` array.
230227

231228

232-
#### `anygantt`-directive attributes
233-
We use this directive to deal with charts included in anygantt-module
234-
(`ganttResource`, `ganttProject`).
229+
#### `anygantt` directive attributes
230+
This directive is used to deal with charts from anygantt module (`ganttResource`, `ganttProject`).
235231

236232
Attribute | View Sample | Controller Sample | Description
237233
--- | --- | --- | ---
238-
ac-type | `<div anygantt ac-type="ganttProject"></div>` | - | Literally means what kind of gantt chart will be created. In current sample, `anychart.ganttProject()`-constructor will be called.
239-
ac-data | `<div anygantt ac-data="myData"></div>` | `$scope.myData = tree;` | By analogue with corresponding directive of `anychart`-directive, we have to put created data tree into `$scope` in specified field.
234+
ac-type | `<div anygantt ac-type="ganttProject"></div>` | - | Kind of gantt chart to be created. In a sample, `anychart.ganttProject()`-constructor will be called.
235+
ac-data | `<div anygantt ac-data="myData"></div>` | `$scope.myData = tree;` | Just as the corresponding directive of `anychart`-directive, data tree is put into a `$scope` in a specified field.
240236
ac-title | `<div anygantt ac-title="My Custom Title"></div>` | - | Sets a string value to a chart title.
241-
ac-instance | `<div anygantt ac-instance="myChart"></div>` | `$scope.myChart = chart;` | Works with predefined chart instance (see `anychart`-directive).
242-
ac-chart-draw | `<div anygantt ac-chart-draw="afterDrawHandler"></div>` | `$scope.afterDrawHandler = function(chart) { ... };` | Works the same way as described in `anychart`-directive.
243-
ac-splitter-position | `<div anygantt ac-splitter-position="300"></div>` | - | Sets gantt chart splitter position. Does the same as `chart.splitterPosition(300)`.
244-
245-
246-
247-
#### `anymap`-directive attributes
248-
We use this directive to deal with charts included in anymap-module
249-
(`choropleth`, `bubbleMap`, etc).
237+
ac-instance | `<div anygantt ac-instance="myChart"></div>` | `$scope.myChart = chart;` | Works with a predefined chart instance (see `anychart` directive).
238+
ac-chart-draw | `<div anygantt ac-chart-draw="afterDrawHandler"></div>` | `$scope.afterDrawHandler = function(chart) { ... };` | Works the same way as described in `anychart` directive.
239+
ac-splitter-position | `<div anygantt ac-splitter-position="300"></div>` | - | Sets gantt chart splitter position.
250240

241+
#### `anymap` directive attributes
242+
This directive is used to deal with charts from anymap module (`choropleth`, `bubbleMap`, etc).
251243

252244
Attribute | View Sample | Controller Sample | Description
253245
--- | --- | --- | ---
254-
ac-type | `<div anymap ac-type="ganttProject"></div>` | - | See `anychart`-directive corresponding attribute.
255-
ac-data | `<div anymap ac-data="myData"></div>` | `$scope.myData = data;` | See `anychart`-directive corresponding attribute.
256-
ac-title | `<div anymap ac-title="My Custom Title"></div>` | - | See `anychart`-directive corresponding attribute.
257-
ac-legend | `<div anymap ac-legend="true"></div>` | - | See `anychart`-directive corresponding attribute.
258-
ac-instance | `<div anymap ac-instance="myChart"></div>` | `$scope.myChart = chart;` | See `anychart`-directive corresponding attribute.
259-
ac-chart-draw | `<div anymap ac-chart-draw="afterDrawHandler"></div>` | `$scope.afterDrawHandler = function(chart) { ... };` | See `anychart`-directive corresponding attribute.
260-
ac-geo-data | `<div anymap ac-geo-data="anychart.maps.australia"></div>` | - | Required attribute. Differs from `ac-data`: `ac-geo-data` sets the data all chart, while `ac-data` is a data for default map series.
261-
246+
ac-type | `<div anymap ac-type="map"></div>` | - | See `anychart` directive corresponding attribute.
247+
ac-data | `<div anymap ac-data="myData"></div>` | `$scope.myData = data;` | See `anychart` directive corresponding attribute.
248+
ac-title | `<div anymap ac-title="My Custom Title"></div>` | - | See `anychart` directive corresponding attribute.
249+
ac-legend | `<div anymap ac-legend="true"></div>` | - | See `anychart` directive corresponding attribute.
250+
ac-instance | `<div anymap ac-instance="myChart"></div>` | `$scope.myChart = chart;` | See `anychart` directive corresponding attribute.
251+
ac-chart-draw | `<div anymap ac-chart-draw="afterDrawHandler"></div>` | `$scope.afterDrawHandler = function(chart) { ... };` | See `anychart` directive corresponding attribute.
252+
ac-geo-data | `<div anymap ac-geo-data="anychart.maps.australia"></div>` | - | Required attribute. Differs from `ac-data`: `ac-geo-data` sets geo data source, `ac-data` is a data for the default map series.
262253

263-
#### `anystock`-directive attributes
264-
Works only with `ac-instance` and `ac-chart-draw` attributes because of very specific
265-
Stock Chart setup.
266254

255+
#### `anystock` directive attributes
256+
Works only with `ac-instance` and `ac-chart-draw` attributes because of the specifics of Stock Chart setup.
267257

268258
## Demos overview
269-
Demos folder content overview.
259+
See these samples to learn how things work:
270260
* **[Anychart_Load_Data_From_Json.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Anychart_Load_Data_From_Json.html)**: Demo of async data loading. Also
271-
shows how AnychartService can be used. **Please, note:** This demo can be run on a server only because of cross origin requests security issues.
272-
* **[Full_Custom_Stage.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Full_Custom_Stage.html)**: Demonstrates how to create and use full custom stage.
273-
* **[Gantt_Project_After_Draw.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Gantt_Project_After_Draw.html)**: Shows how to simply create Gantt Project
274-
Chart and setup after-draw handler.
261+
shows how AnychartService can be used. **Please, note:** This demo can launched only from a web-server, in browser window, because of cross origin requests security issues.
262+
* **[Custom_Stage.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Full_Custom_Stage.html)**: Demonstrates how to create and use a custom stage.
263+
* **[Gantt_Project_After_Draw.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Gantt_Project_After_Draw.html)**: Shows how to create Gantt Project
264+
Chart and add the after-draw handler.
275265
* **[Gantt_Resource_Instance_Usage.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Gantt_Resource_Instance_Usage.html)**: Shows how to use manually created
276-
instance og Gantt Resource chart and how to add after draw handler.
266+
instance of a Gantt Resource chart and how to add the after-draw handler.
277267
* **[Line_Chart_After_Draw.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Line_Chart_After_Draw.html)**: Demonstrates how to create and use instance
278-
of chart and add after draw handler.
279-
* **[Line_Chart_Data_Streaming.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Line_Chart_Data_Streaming.html)**: Simple data streaming demo.
268+
of a chart and add the after-draw handler.
269+
* **[Line_Chart_Data_Streaming.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Line_Chart_Data_Streaming.html)**: Simple data-streaming demo.
280270
* **[Simple_Charts_On_Stage.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Simple_Charts_On_Stage.html)**: Demonstrates how to create and add simple
281-
charts on anychart stage and how to add after draw handler.
271+
charts on the anychart stage and how to add the after-draw handler.
282272
* **[Simple_Gantt_Project.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Simple_Gantt_Project.html)**: Simple Gantt Project Chart demo.
283273
* **[Simple_Map.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Simple_Map.html)**: Simple Anymap demo.
284-
* **[Simple_Pie.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Simple_Pie.html)**: Simple pie-chart demo.
285-
* **[Simple_Stock_Area.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Simple_Stock_Area.html)**: Simple Anystock demo.
274+
* **[Simple_Pie.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Simple_Pie.html)**: Simple Pie chart demo.
275+
* **[Simple_Stock_Area.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Simple_Stock_Area.html)**: Simple AnyStock demo.
286276
* **[Software_Sales_Dashboard.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/Software_Sales_Dashboard.html)**: Demonstrates how to use `anychart-stage`
287-
directive to build interactive dashboard.
277+
directive to build the interactive dashboard.
288278
* **[World_Map_Instance_After_Draw.html](https://github.com/AnyChart/AnyChart-AngularJS/blob/master/demos/World_Map_Instance_After_Draw.html)**: World map demo. Shows how to
289-
use map chart instance and how to add after draw handler.
279+
use map chart instance and how to add the after-draw handler.
290280

291281

292282
## Contacts

0 commit comments

Comments
 (0)