Skip to content

Commit 1be5149

Browse files
committed
Merge branch 'next' into develop
* next: πŸ“ Update CHANGELOG πŸ’Ž Release new version 2.1.0 ✨ Add travis config πŸ› Fix tests ✨ Add chartId as prop and fix width and height props ✨ Add bubble-chart example βœ… Add tests ✨ Add chart type Bubble Move examples into src for better testing πŸ“ Update README πŸ’Ž Release new version 2.0.0-alpha Add vue 2.0 build files πŸ“ Update README ⬆️ Update dependency chartjs to 2.2.1 Update examples ⬆️ Update dependency vue 2.0 Change deprecated v-el to ref Change render() method name to renderChart # Conflicts: # CHANGELOG.md # dist/vue-chartjs.js # dist/vue-chartjs.js.map # package.json # src/BaseCharts/Bar.js # src/BaseCharts/Bubble.js # src/BaseCharts/Doughnut.js # src/BaseCharts/Line.js # src/BaseCharts/Pie.js # src/BaseCharts/PolarArea.js # src/BaseCharts/Radar.js # src/examples/App.vue # src/examples/BubbleExample.js # test/unit/specs/Bar.spec.js # test/unit/specs/Bubble.spec.js # test/unit/specs/Doughnut.spec.js # test/unit/specs/Line.spec.js # test/unit/specs/Pie.spec.js # test/unit/specs/PolarArea.spec.js # test/unit/specs/Radar.spec.js
2 parents b8e7ce1 + 7d256e6 commit 1be5149

29 files changed

+218
-102
lines changed

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
4+
## [v.2.1.0](https://github.com/apertureless/vue-chartjs/tree/v.2.1.0) (2016-09-23)
5+
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v1.1.3...v.2.1.0)
6+
7+
38
## [v1.1.3](https://github.com/apertureless/vue-chartjs/tree/v1.1.3) (2016-09-08)
49
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/1.1.2...v1.1.3)
510

@@ -47,4 +52,4 @@
4752
## [1.0.2](https://github.com/apertureless/vue-chartjs/tree/1.0.2) (2016-07-27)
4853

4954

50-
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
55+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

β€ŽREADME.mdβ€Ž

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
> VueJS wrapper for ChartJs
66
7+
# 🚧 VUE 2.0 WIP ⚠
8+
79
## Install
810

9-
Simply run `npm install vue-chartjs`
11+
Simply run `npm install vue-chartjs@next`
1012

1113
## How to use
1214

@@ -26,9 +28,9 @@ Just create your own component.
2628
import { Bar } from 'vue-chartjs'
2729

2830
export default BarChart.extend({
29-
ready () {
31+
mounted () {
3032
// Overwriting base render method with actual data.
31-
this.render({
33+
this.renderChart({
3234
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
3335
datasets: [
3436
{
@@ -58,8 +60,8 @@ import { Line } from 'vue-chartjs'
5860

5961
export default LineChart.extend({
6062
props: [data, options],
61-
ready () {
62-
this.render(this.data, this.options)
63+
mounted () {
64+
this.renderChart(this.data, this.options)
6365
}
6466
})
6567
```

β€Žbuild/webpack.base.conf.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = {
1616
extensions: ['', '.js', '.vue'],
1717
fallback: [path.join(__dirname, '../node_modules')],
1818
alias: {
19+
'vue': 'vue/dist/vue.js',
1920
'src': path.resolve(__dirname, '../src'),
2021
'BaseCharts': path.resolve(__dirname, '../src/BaseCharts')
2122
}

β€Ždist/vue-chartjs.jsβ€Ž

Lines changed: 18 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/vue-chartjs.js.mapβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žindex.htmlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<title>Vue-ChartJs</title>
66
</head>
77
<body>
8+
<div id="app">
89
<app></app>
10+
</div>
911
<!-- built files will be auto injected -->
1012
</body>
1113
</html>

β€Žpackage.jsonβ€Ž

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-chartjs",
3-
"version": "1.1.3",
3+
"version": "2.1.0",
44
"description": "Vue wrapper for chart.js",
55
"author": "Jakub Juszczak <[email protected]>",
66
"repository": {
@@ -21,18 +21,18 @@
2121
"unit": "karma start test/unit/karma.conf.js --single-run",
2222
"e2e": "node test/e2e/runner.js",
2323
"test": "npm run unit",
24-
"lint": "eslint --ext .js,.vue src test/unit/specs",
24+
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
2525
"prepublish": "node build/build.js"
2626
},
2727
"dependencies": {
28-
"babel-runtime": "^6.0.0",
29-
"chart.js": "^2.1.6",
30-
"vue": "^1.0.21"
28+
"babel-runtime": "^6.11.6",
29+
"chart.js": "^2.2.1",
30+
"vue": "^2.0.0-rc.1"
3131
},
3232
"devDependencies": {
33-
"babel-core": "^6.0.0",
33+
"babel-core": "^6.10.4",
3434
"babel-loader": "^6.0.0",
35-
"babel-plugin-transform-runtime": "^6.0.0",
35+
"babel-plugin-transform-runtime": "^6.12.0",
3636
"babel-preset-es2015": "^6.0.0",
3737
"babel-preset-stage-2": "^6.0.0",
3838
"chai": "^3.5.0",
@@ -76,11 +76,11 @@
7676
"sinon": "^1.17.3",
7777
"sinon-chai": "^2.8.0",
7878
"url-loader": "^0.5.7",
79-
"vue-hot-reload-api": "^1.2.0",
80-
"vue-html-loader": "^1.0.0",
81-
"vue-loader": "^8.3.0",
79+
"vue-hot-reload-api": "^2.0.6",
80+
"vue-html-loader": "^1.2.3",
81+
"vue-loader": "^9.3.0",
8282
"vue-style-loader": "^1.0.0",
83-
"webpack": "^1.12.2",
83+
"webpack": "^1.13.2",
8484
"webpack-dev-middleware": "^1.4.0",
8585
"webpack-hot-middleware": "^2.6.0",
8686
"webpack-merge": "^0.8.3"

β€Žsrc/BaseCharts/Bar.jsβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="{{chartId}}" width="{{width}}" height="{{height}}" v-el:canvas></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

@@ -49,11 +49,11 @@ export default Vue.extend({
4949
},
5050

5151
methods: {
52-
render (data, options) {
52+
renderChart (data, options) {
5353
let chartOptions = mergeOptions(this.defaultOptions, options)
5454

5555
this._chart = new Chart(
56-
this.$els.canvas.getContext('2d'), {
56+
this.$refs.canvas.getContext('2d'), {
5757
type: 'bar',
5858
data: data,
5959
options: chartOptions

β€Žsrc/BaseCharts/Bubble.jsβ€Ž

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

@@ -27,16 +27,33 @@ export default Vue.extend({
2727
data () {
2828
return {
2929
defaultOptions: {
30+
scales: {
31+
yAxes: [{
32+
ticks: {
33+
beginAtZero: true
34+
},
35+
gridLines: {
36+
display: false
37+
}
38+
}],
39+
xAxes: [ {
40+
gridLines: {
41+
display: false
42+
},
43+
categoryPercentage: 0.5,
44+
barPercentage: 0.2
45+
}]
46+
}
3047
}
3148
}
3249
},
3350

3451
methods: {
35-
render (data, options) {
52+
renderChart (data, options) {
3653
let chartOptions = mergeOptions(this.defaultOptions, options)
3754

3855
this._chart = new Chart(
39-
this.$els.canvas.getContext('2d'), {
56+
this.$refs.canvas.getContext('2d'), {
4057
type: 'bubble',
4158
data: data,
4259
options: chartOptions

β€Žsrc/BaseCharts/Doughnut.jsβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

@@ -32,11 +32,11 @@ export default Vue.extend({
3232
},
3333

3434
methods: {
35-
render (data, options) {
35+
renderChart (data, options) {
3636
let chartOptions = mergeOptions(this.defaultOptions, options)
3737

3838
this._chart = new Chart(
39-
this.$els.canvas.getContext('2d'), {
39+
this.$refs.canvas.getContext('2d'), {
4040
type: 'doughnut',
4141
data: data,
4242
options: chartOptions

0 commit comments

Comments
Β (0)