Skip to content

Commit 1058c6f

Browse files
committed
Merge branch 'master' of github.com:AnyChart/AnyChart-jQuery
2 parents a8a3fd8 + a3e827f commit 1058c6f

8 files changed

+134
-42
lines changed

README.md

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[<img src="https://cdn.anychart.com/images/logo-transparent-segoe.png?2" width="234px" alt="AnyChart - Robust JavaScript/HTML5 Chart library for any project">](http://www.anychart.com)
22

3-
jQuery plugin for AnyChart.
3+
jQuery Plugin for AnyChart.
44
=========
55

66
jQuery plugin for AnyChart provides an easy way to use [AnyChart JavaScript Charts](http://anychart.com) with jQuery framework.
@@ -10,6 +10,7 @@ jQuery plugin for AnyChart provides an easy way to use [AnyChart JavaScript Char
1010
* [Download and Install](#download-and-install)
1111
* [Quick Start](#quick-start)
1212
* [Examples Overview](#examples-overview)
13+
* [API Overview](#api-overview)
1314
* [Contacts](#contacts)
1415
* [Links](#links)
1516
* [License](#license)
@@ -24,7 +25,7 @@ Binaries are located in [dist](https://github.com/AnyChart/AnyChart-jQuery/tree/
2425

2526
#### Package managers
2627

27-
You can install AnyChart-React using **npm**, **bower** or **yarn**:
28+
You can install AnyChart-jQuery using **npm**, **bower** or **yarn**:
2829

2930
* `npm install anychart-jquery`
3031
* `bower install anychart-jquery`
@@ -37,7 +38,7 @@ Here is a basic sample that shows how to add a column chart:
3738
<!doctype html>
3839
<html>
3940
<head>
40-
<!-- Add jQuery -->
41+
<!-- Add jQuery -->
4142
<script src="js/vendor/jquery-3.1.1.min.js"></script>
4243
<!-- Add anychart-bundle -->
4344
<script src="js/anychart-bundle.min.js"></script>
@@ -47,7 +48,7 @@ Here is a basic sample that shows how to add a column chart:
4748
<body>
4849
<div id="container" style="width: 640px; height: 480px;"></div>
4950
<script>
50-
// Render column chart to #container
51+
// Render a column chart to a #container
5152
$('#container').anychart('column', [3, 1, 2]);
5253
</script>
5354
</body>
@@ -56,7 +57,7 @@ Here is a basic sample that shows how to add a column chart:
5657

5758
## API Overview
5859
#### `$(selector).anychart();`
59-
Returns instance of a chart if it was rendered to continer, `null` otherwise.
60+
Returns an instance of a chart if it is rendered to a container. Returns `null` otherwise.
6061

6162
```
6263
$(selector).anychart('line', [3, 1, 2]);
@@ -65,7 +66,7 @@ chart.background('red');
6566
```
6667

6768
#### `$(selector).anychartStage();`
68-
Returns instance of a stage if it was rendered to container, `null` otherwise.
69+
Returns an instance of a stage if it was rendered to a container. Returns `null` otherwise.
6970

7071
```
7172
// e.g. create and setup chart1, chart2, chart3
@@ -76,56 +77,56 @@ stage.width(400);
7677
```
7778

7879
#### `$(selector).anychart(type, var_args);`
79-
Renders `type` chart to container.
80+
Renders `type` chart to a container.
8081

81-
`type` can be either any of AnyChart chart types or `stock`, `ganttProject`, `ganttResource`.
82+
`type` can be any of AnyChart chart types or `stock`, `ganttProject`, `ganttResource`.
8283

83-
`var_args` are data that will be passed to a chart constructor.
84+
`var_args` are data that is passed to the chart constructor.
8485

8586
```
86-
// create line chart with 2 series
87+
// create a line chart with 2 series
8788
$(selector).anychart('line', [3, 1, 2], [5, 4, 3]);
8889
```
89-
Other use cases you can find in [`examples`](https://github.com/AnyChart/AnyChart-jQuery/tree/master/examples) folder
90+
Other use cases you can find in [AnyChart jQuery examples](https://github.com/AnyChart/AnyChart-jQuery/tree/master/examples) folder
9091

9192
#### `$(selector).anychart(type, geoData, var_args);`
92-
Renders map chart to container.
93+
Renders a map to a container.
9394

94-
`type` can be one of `bubbleMap`, `choropleth`, `connector`, `markerMap`, `seatMap`
95+
`type` can be: `bubbleMap`, `choropleth`, `connector`, `markerMap`, `seatMap`
9596

96-
`geoData` can be string or Object with geo data.
97+
`geoData` can be a string or an object with geo data.
9798

9899
`var_args` are chart data.
99100

100101
```
101-
// create choroplet map with australia geodata.
102+
// create a choropleth series on the australia map
102103
$(selector).anychart('choropleth', 'anychart.maps.australia', data);
103104
```
104105

105106
#### `$(selector).anychartStage(var_args);`
106107
Renders preconfigured charts to a [stage](http://docs.anychart.com/latest/Graphics/Basics).
107108

108-
`var_args` are charts that will be rendered to stage.
109+
`var_args` are charts to be rendered to on a stage.
109110

110111
```
111112
// create and setup chart1, chart2, chart3
112113
// ....
113-
// Render it to stage.
114+
// Render them to a stage.
114115
$(selector).anychartStage(chart1, chart2, chart3);
115116
```
116117

117118

118119

119120
## Examples Overview
120-
See these examples to learn how things work:
121+
See examples to learn how things work:
121122

122-
* **[async_data_load.html](https://github.com/anychart/anychart-jquery/blob/master/examples/async_data_load.html)**: Example of async data load.
123-
* **[choropleth_map.html](https://github.com/anychart/anychart-jquery/blob/master/examples/choropleth_map.html)**: Example of choropleth map.
124-
* **[gantt.html](https://github.com/anychart/anychart-jquery/blob/master/examples/gantt.html)**: Example of gantt chart.
125-
* **[multiple_charts.html](https://github.com/anychart/anychart-jquery/blob/master/examples/multiple_charts.html)**: Example of working with multiple charts.
123+
* **[async_data_load.html](https://github.com/anychart/anychart-jquery/blob/master/examples/async_data_load.html)**: Async data loading.
124+
* **[choropleth_map.html](https://github.com/anychart/anychart-jquery/blob/master/examples/choropleth_map.html)**: Choropleth (colored) map.
125+
* **[gantt.html](https://github.com/anychart/anychart-jquery/blob/master/examples/gantt.html)**: A gantt chart.
126+
* **[multiple_charts.html](https://github.com/anychart/anychart-jquery/blob/master/examples/multiple_charts.html)**: Handling multiple charts.
126127
* **[simple_chart_update.html](https://github.com/anychart/anychart-jquery/blob/master/examples/simple_chart_update.html)**: Simple chart which can be updated (switch type, change background).
127-
* **[simple_dashboard.html](https://github.com/anychart/anychart-jquery/blob/master/examples/simple_dashboard.html)**: Example of simple dashboard.
128-
* **[stock.html](https://github.com/anychart/anychart-jquery/blob/master/examples/stock.html)**: Example of stock chart.
128+
* **[simple_dashboard.html](https://github.com/anychart/anychart-jquery/blob/master/examples/simple_dashboard.html)**: A simple dashboard.
129+
* **[stock.html](https://github.com/anychart/anychart-jquery/blob/master/examples/stock.html)**: A stock chart.
129130

130131

131132
## Contacts
@@ -142,7 +143,7 @@ See these examples to learn how things work:
142143
* [Download AnyChart](http://www.anychart.com/download/)
143144
* [AnyChart Licensing](http://www.anychart.com/buy/)
144145
* [AnyChart Support](http://www.anychart.com/support/)
145-
* [Report Issues](http://github.com/AnyChart/anychart/issues)
146+
* [Report Issues](https://github.com/AnyChart/AnyChart-jQuery/issues)
146147
* [AnyChart Playground](http://playground.anychart.com)
147148
* [AnyChart Documentation](http://docs.anychart.com)
148149
* [AnyChart API Reference](http://api.anychart.com)
@@ -151,4 +152,4 @@ See these examples to learn how things work:
151152

152153
## License
153154

154-
[© AnyChart.com - JavaScript charts](http://www.anychart.com). Released under the [Apache 2.0 License](https://github.com/anychart-integrations/ruby-sinatra-mysql-template/blob/master/LICENSE).
155+
[© AnyChart.com - JavaScript charts](http://www.anychart.com). AnyChart jQuery plugin is released under the [Apache 2.0 License](https://github.com/AnyChart/AnyChart-jQuery/blob/master/LICENSE).

examples/async_data_load.html

+18-4
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,38 @@
55
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
66
<script src="../dist/anychart-jquery.min.js"></script>
77
<link rel="stylesheet" href="assets/anychart-ui.min.css"/>
8+
<style>
9+
html, body {
10+
margin: 0;
11+
padding: 0;
12+
}
13+
14+
#load {
15+
margin: 15px 0 10px 15px;
16+
}
17+
18+
#container {
19+
width: 640px;
20+
height: 480px;
21+
}
22+
</style>
823
</head>
924
<body>
10-
<div id="container" style="width: 640px; height: 480px;"></div>
1125
<button id="load">load new data</button>
26+
<div id="container"></div>
1227
<script>
1328
var cnt = $('#container');
1429
cnt.anychart('line', [3, 1, 2]);
1530

16-
$('#load').click(function() {
31+
$('#load').click(function () {
1732
$.ajax({
1833
url: 'assets/data.json',
1934
type: 'GET',
2035
dataType: 'json'
21-
}).done(function(json) {
36+
}).done(function (json) {
2237
cnt.anychart().data(json);
2338
})
2439
});
25-
2640
</script>
2741
</body>
2842
</html>

examples/choropleth_map.html

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@
77
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
88
<script src="../dist/anychart-jquery.min.js"></script>
99
<link rel="stylesheet" href="assets/anychart-ui.min.css"/>
10+
<style>
11+
html, body {
12+
margin: 0;
13+
padding: 0;
14+
}
15+
16+
#container {
17+
width: 800px;
18+
height: 600px;
19+
}
20+
</style>
1021
</head>
1122
<body>
12-
<div id="container" style="width: 800px; height: 600px;"></div>
23+
<div id="container"></div>
1324
<script>
1425
$(document).ready(function() {
1526
var data = anychart.data.set([

examples/gantt.html

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,26 @@
66
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
77
<script src="../dist/anychart-jquery.min.js"></script>
88
<link rel="stylesheet" href="assets/anychart-ui.min.css"/>
9+
<style>
10+
html, body {
11+
margin: 0;
12+
padding: 0;
13+
}
14+
15+
#container {
16+
width: 800px;
17+
height: 537px;
18+
}
19+
</style>
920
</head>
1021
<body>
11-
<div id="container" style="width: 800px; height: 480px;"></div>
22+
<div id="container"></div>
1223
<script>
1324
var data = anychart.data.tree(getData(), anychart.enums.TreeFillingMethod.AS_TREE);
1425
var cnt = $('#container');
1526
cnt.anychart('ganttProject', data);
1627
var chart = cnt.anychart();
28+
chart.splitterPosition(223);
1729
chart.fitAll();
1830
</script>
1931
</body>

examples/multiple_charts.html

+10-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,22 @@
1111
width: 400px;
1212
height: 200px;
1313
}
14+
15+
html, body {
16+
margin: 0;
17+
padding: 0;
18+
}
19+
20+
#bg {
21+
margin: 15px 0 10px 15px;
22+
}
1423
</style>
1524
</head>
1625
<body>
26+
<button id="bg">change backgrounds</button>
1727
<div class="chart"></div>
1828
<div class="chart"></div>
1929
<div class="chart"></div>
20-
<button id="bg">change backgrounds</button>
2130
<script>
2231
var cnts = $('.chart');
2332

@@ -30,7 +39,6 @@
3039
$(this).anychart().background(bg[index] + ' .5');
3140
});
3241
})
33-
3442
</script>
3543
</body>
3644
</html>

examples/simple_chart_update.html

+23-5
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,38 @@
55
<script src="../node_modules/anychart/dist/anychart-bundle.min.js"></script>
66
<script src="../dist/anychart-jquery.min.js"></script>
77
<link rel="stylesheet" href="assets/anychart-ui.min.css"/>
8+
9+
<style>
10+
html, body {
11+
margin: 0;
12+
padding: 0;
13+
}
14+
15+
#container {
16+
width: 640px;
17+
height: 480px;
18+
}
19+
20+
.buttons-container {
21+
margin: 15px 0 10px 15px;
22+
}
23+
</style>
824
</head>
925
<body>
10-
<div id="container" style="width: 640px; height: 480px;"></div>
11-
<button id="pie">render pie chart</button>
12-
<button id="bg">change background to pink</button>
26+
<div class="buttons-container">
27+
<button id="pie">render pie chart</button>
28+
<button id="bg">change background to pink</button>
29+
</div>
30+
<div id="container" style=""></div>
1331
<script>
1432
var cnt = $('#container');
1533
cnt.anychart('line', [3, 1, 2]);
1634

17-
$('#pie').click(function() {
35+
$('#pie').click(function () {
1836
cnt.anychart('pie', [4, 3, 3, 4]);
1937
});
2038

21-
$('#bg').click(function() {
39+
$('#bg').click(function () {
2240
cnt.anychart().background('pink');
2341
})
2442
</script>

examples/simple_dashboard.html

+18-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,26 @@
55
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
66
<script src="../dist/anychart-jquery.min.js"></script>
77
<link rel="stylesheet" href="assets/anychart-ui.min.css"/>
8+
9+
<style>
10+
html, body {
11+
margin: 0;
12+
padding: 0;
13+
}
14+
15+
#button {
16+
margin: 15px 0 10px 15px;
17+
}
18+
19+
#container {
20+
width: 800px;
21+
height: 600px;
22+
}
23+
</style>
824
</head>
925
<body>
1026
<button id="button">Render another dashboard</button>
11-
<div id="container" style="width: 800px; height: 600px;"></div>
27+
<div id="container"></div>
1228
<script>
1329
var cnt = $('#container');
1430
var chart1 = anychart.column([2, 4, 2, 1]);
@@ -26,7 +42,7 @@
2642

2743
cnt.anychartStage(chart1, chart2);
2844

29-
$('button').click(function() {
45+
$('button').click(function () {
3046
cnt.anychartStage(chart3, chart4);
3147
})
3248
</script>

examples/stock.html

+13-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,21 @@
1010
<script src="assets/csco-daily-short.js"></script>
1111
<script src="assets/ibm-daily-short.js"></script>
1212
<link rel="stylesheet" href="assets/anychart-ui.min.css"/>
13+
14+
<style>
15+
html, body {
16+
margin: 0;
17+
padding: 0;
18+
}
19+
20+
#container {
21+
width: 800px;
22+
height: 600px;
23+
}
24+
</style>
1325
</head>
1426
<body>
15-
<div id="container" style="width: 800px; height: 600px;"></div>
27+
<div id="container"></div>
1628
<script>
1729
var chart = $('#container').anychart('stock').anychart();
1830

0 commit comments

Comments
 (0)