mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 18:00:20 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9f95fd737 | ||
|
|
e3f9936049 | ||
|
|
2f66dd9a44 | ||
|
|
a3bed8b8b6 | ||
|
|
e48f4eaeec | ||
|
|
57f3c651ed | ||
|
|
3c5c572a86 | ||
|
|
c677dcb55a | ||
|
|
f5005fbd67 | ||
|
|
5258ab1a0f | ||
|
|
df7b6ec93e | ||
|
|
9a8e8d6e1e |
10
.github/CONTRIBUTING.md
vendored
Normal file
10
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Thank you for contributing vue-chartjs!
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
Please follow this steps:
|
||||||
|
|
||||||
|
1. Fork it ( https://github.com/apertureless/vue-chartjs/fork )
|
||||||
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
||||||
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||||
|
4. Push to the branch (`git push origin my-new-feature`)
|
||||||
|
5. Create a new Pull Request
|
||||||
14
.github/ISSUE_TEMPLATE.md
vendored
Normal file
14
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
### Expected Behavior
|
||||||
|
|
||||||
|
|
||||||
|
### Actual Behavior
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Environment
|
||||||
|
- OS: Write here
|
||||||
|
- NPM Version: Write here
|
||||||
|
|
||||||
12
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
12
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
### Fix or Enhancement?
|
||||||
|
|
||||||
|
|
||||||
|
- [ ] All tests passed
|
||||||
|
|
||||||
|
|
||||||
|
### Environment
|
||||||
|
- OS: Write here
|
||||||
|
- NPM Version: Write here
|
||||||
|
|
||||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,8 +1,18 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
## [Unreleased](https://github.com/apertureless/vue-chartjs/tree/HEAD)
|
## [1.1.0](https://github.com/apertureless/vue-chartjs/tree/1.1.0) (2016-08-21)
|
||||||
|
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/1.0.3...1.1.0)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/1.0.2...HEAD)
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Use Vue.util.mergeOptions to merge default options with user's options [\#5](https://github.com/apertureless/vue-chartjs/issues/5)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Feature/merge options \#5 [\#6](https://github.com/apertureless/vue-chartjs/pull/6) ([apertureless](https://github.com/apertureless))
|
||||||
|
|
||||||
|
## [1.0.3](https://github.com/apertureless/vue-chartjs/tree/1.0.3) (2016-08-20)
|
||||||
|
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/1.0.2...1.0.3)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
|||||||
13
CODE_OF_CONDUCT.md
Normal file
13
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Contributor Code of Conduct
|
||||||
|
|
||||||
|
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
||||||
|
|
||||||
|
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
||||||
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2016 Jakub Juszczak
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
14
README.md
14
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Vue-ChartJs
|
# Vue-ChartJs
|
||||||
|
|
||||||
[] (https://badge.fury.io/js/vue-chartjs) 
|
[](https://badge.fury.io/js/vue-chartjs) 
|
||||||
|
|
||||||
> VueJS wrapper for ChartJs
|
> VueJS wrapper for ChartJs
|
||||||
|
|
||||||
@@ -142,3 +142,15 @@ npm test
|
|||||||
```
|
```
|
||||||
|
|
||||||
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
1. Fork it ( https://github.com/apertureless/vue-chartjs/fork )
|
||||||
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
||||||
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||||
|
4. Push to the branch (`git push origin my-new-feature`)
|
||||||
|
5. Create a new Pull Request
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This software is distributed under [MIT license](LICENSE.txt).
|
||||||
|
|||||||
34
dist/vue-chartjs.js
vendored
34
dist/vue-chartjs.js
vendored
File diff suppressed because one or more lines are too long
2
dist/vue-chartjs.js.map
vendored
2
dist/vue-chartjs.js.map
vendored
File diff suppressed because one or more lines are too long
25
package.json
25
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-chartjs",
|
"name": "vue-chartjs",
|
||||||
"version": "1.0.3",
|
"version": "1.1.1",
|
||||||
"description": "Vue wrapper for chart.js",
|
"description": "Vue wrapper for chart.js",
|
||||||
"author": "Jakub Juszczak <jakub@nextindex.de>",
|
"author": "Jakub Juszczak <jakub@nextindex.de>",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -34,13 +34,16 @@
|
|||||||
"babel-plugin-transform-runtime": "^6.0.0",
|
"babel-plugin-transform-runtime": "^6.0.0",
|
||||||
"babel-preset-es2015": "^6.0.0",
|
"babel-preset-es2015": "^6.0.0",
|
||||||
"babel-preset-stage-2": "^6.0.0",
|
"babel-preset-stage-2": "^6.0.0",
|
||||||
|
"chai": "^3.5.0",
|
||||||
|
"chromedriver": "^2.21.2",
|
||||||
"connect-history-api-fallback": "^1.1.0",
|
"connect-history-api-fallback": "^1.1.0",
|
||||||
|
"cross-spawn": "^2.1.5",
|
||||||
"css-loader": "^0.23.0",
|
"css-loader": "^0.23.0",
|
||||||
"eslint": "^2.10.2",
|
"eslint": "^2.10.2",
|
||||||
|
"eslint-config-standard": "^5.1.0",
|
||||||
"eslint-friendly-formatter": "^2.0.5",
|
"eslint-friendly-formatter": "^2.0.5",
|
||||||
"eslint-loader": "^1.3.0",
|
"eslint-loader": "^1.3.0",
|
||||||
"eslint-plugin-html": "^1.3.0",
|
"eslint-plugin-html": "^1.3.0",
|
||||||
"eslint-config-standard": "^5.1.0",
|
|
||||||
"eslint-plugin-promise": "^1.0.8",
|
"eslint-plugin-promise": "^1.0.8",
|
||||||
"eslint-plugin-standard": "^1.3.2",
|
"eslint-plugin-standard": "^1.3.2",
|
||||||
"eventsource-polyfill": "^0.9.6",
|
"eventsource-polyfill": "^0.9.6",
|
||||||
@@ -50,6 +53,8 @@
|
|||||||
"function-bind": "^1.0.2",
|
"function-bind": "^1.0.2",
|
||||||
"html-webpack-plugin": "^2.8.1",
|
"html-webpack-plugin": "^2.8.1",
|
||||||
"http-proxy-middleware": "^0.12.0",
|
"http-proxy-middleware": "^0.12.0",
|
||||||
|
"inject-loader": "^2.0.1",
|
||||||
|
"isparta-loader": "^2.0.0",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
"karma": "^0.13.15",
|
"karma": "^0.13.15",
|
||||||
"karma-coverage": "^0.5.5",
|
"karma-coverage": "^0.5.5",
|
||||||
@@ -59,20 +64,16 @@
|
|||||||
"karma-sourcemap-loader": "^0.3.7",
|
"karma-sourcemap-loader": "^0.3.7",
|
||||||
"karma-spec-reporter": "0.0.24",
|
"karma-spec-reporter": "0.0.24",
|
||||||
"karma-webpack": "^1.7.0",
|
"karma-webpack": "^1.7.0",
|
||||||
|
"lodash": "^4.15.0",
|
||||||
"lolex": "^1.4.0",
|
"lolex": "^1.4.0",
|
||||||
"mocha": "^2.4.5",
|
"mocha": "^2.4.5",
|
||||||
"chai": "^3.5.0",
|
"nightwatch": "^0.8.18",
|
||||||
|
"ora": "^0.2.0",
|
||||||
|
"phantomjs-prebuilt": "^2.1.3",
|
||||||
|
"selenium-server": "2.53.0",
|
||||||
|
"shelljs": "^0.6.0",
|
||||||
"sinon": "^1.17.3",
|
"sinon": "^1.17.3",
|
||||||
"sinon-chai": "^2.8.0",
|
"sinon-chai": "^2.8.0",
|
||||||
"inject-loader": "^2.0.1",
|
|
||||||
"isparta-loader": "^2.0.0",
|
|
||||||
"phantomjs-prebuilt": "^2.1.3",
|
|
||||||
"chromedriver": "^2.21.2",
|
|
||||||
"cross-spawn": "^2.1.5",
|
|
||||||
"nightwatch": "^0.8.18",
|
|
||||||
"selenium-server": "2.53.0",
|
|
||||||
"ora": "^0.2.0",
|
|
||||||
"shelljs": "^0.6.0",
|
|
||||||
"url-loader": "^0.5.7",
|
"url-loader": "^0.5.7",
|
||||||
"vue-hot-reload-api": "^1.2.0",
|
"vue-hot-reload-api": "^1.2.0",
|
||||||
"vue-html-loader": "^1.0.0",
|
"vue-html-loader": "^1.0.0",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Chart from 'chart.js'
|
import Chart from 'chart.js'
|
||||||
|
import { mergeOptions } from '../helpers/options'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
@@ -21,7 +22,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
options: {
|
defaultOptions: {
|
||||||
scales: {
|
scales: {
|
||||||
yAxes: [{
|
yAxes: [{
|
||||||
ticks: {
|
ticks: {
|
||||||
@@ -44,12 +45,14 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
render (data, options = this.options) {
|
render (data, options) {
|
||||||
|
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||||
|
|
||||||
this._chart = new Chart(
|
this._chart = new Chart(
|
||||||
this.$els.canvas.getContext('2d'), {
|
this.$els.canvas.getContext('2d'), {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: data,
|
data: data,
|
||||||
options: options
|
options: chartOptions
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this._chart.generateLegend()
|
this._chart.generateLegend()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Chart from 'chart.js'
|
import Chart from 'chart.js'
|
||||||
|
import { mergeOptions } from '../helpers/options'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
@@ -21,18 +22,20 @@ export default Vue.extend({
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
options: {
|
defaultOptions: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
render (data, options = this.options) {
|
render (data, options) {
|
||||||
|
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||||
|
|
||||||
this._chart = new Chart(
|
this._chart = new Chart(
|
||||||
this.$els.canvas.getContext('2d'), {
|
this.$els.canvas.getContext('2d'), {
|
||||||
type: 'doughnut',
|
type: 'doughnut',
|
||||||
data: data,
|
data: data,
|
||||||
options: options
|
options: chartOptions
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this._chart.generateLegend()
|
this._chart.generateLegend()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Chart from 'chart.js'
|
import Chart from 'chart.js'
|
||||||
|
import { mergeOptions } from '../helpers/options'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
@@ -21,7 +22,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
options: {
|
defaultOptions: {
|
||||||
scales: {
|
scales: {
|
||||||
yAxes: [{
|
yAxes: [{
|
||||||
ticks: {
|
ticks: {
|
||||||
@@ -42,12 +43,14 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
render (data, options = this.options) {
|
render (data, options) {
|
||||||
|
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||||
|
|
||||||
this._chart = new Chart(
|
this._chart = new Chart(
|
||||||
this.$els.canvas.getContext('2d'), {
|
this.$els.canvas.getContext('2d'), {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: data,
|
data: data,
|
||||||
options: options
|
options: chartOptions
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this._chart.generateLegend()
|
this._chart.generateLegend()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Chart from 'chart.js'
|
import Chart from 'chart.js'
|
||||||
|
import { mergeOptions } from '../helpers/options'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
@@ -21,18 +22,20 @@ export default Vue.extend({
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
options: {
|
defaultOptions: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
render (data, options = this.options) {
|
render (data, options) {
|
||||||
|
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||||
|
|
||||||
this._chart = new Chart(
|
this._chart = new Chart(
|
||||||
this.$els.canvas.getContext('2d'), {
|
this.$els.canvas.getContext('2d'), {
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
data: data,
|
data: data,
|
||||||
options: options
|
options: chartOptions
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this._chart.generateLegend()
|
this._chart.generateLegend()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Chart from 'chart.js'
|
import Chart from 'chart.js'
|
||||||
|
import { mergeOptions } from '../helpers/options'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
@@ -21,18 +22,20 @@ export default Vue.extend({
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
options: {
|
defaultOptions: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
render (data, options = this.options) {
|
render (data, options) {
|
||||||
|
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||||
|
|
||||||
this._chart = new Chart(
|
this._chart = new Chart(
|
||||||
this.$els.canvas.getContext('2d'), {
|
this.$els.canvas.getContext('2d'), {
|
||||||
type: 'polarArea',
|
type: 'polarArea',
|
||||||
data: data,
|
data: data,
|
||||||
options: options
|
options: chartOptions
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this._chart.generateLegend()
|
this._chart.generateLegend()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Chart from 'chart.js'
|
import Chart from 'chart.js'
|
||||||
|
import { mergeOptions } from '../helpers/options'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
@@ -21,18 +22,20 @@ export default Vue.extend({
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
options: {
|
defaultOptions: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
render (data, options = this.options) {
|
render (data, options) {
|
||||||
|
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||||
|
|
||||||
this._chart = new Chart(
|
this._chart = new Chart(
|
||||||
this.$els.canvas.getContext('2d'), {
|
this.$els.canvas.getContext('2d'), {
|
||||||
type: 'radar',
|
type: 'radar',
|
||||||
data: data,
|
data: data,
|
||||||
options: options
|
options: chartOptions
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this._chart.generateLegend()
|
this._chart.generateLegend()
|
||||||
|
|||||||
5
src/helpers/options.js
Normal file
5
src/helpers/options.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import merge from 'lodash/fp/merge'
|
||||||
|
|
||||||
|
export function mergeOptions (obj, src) {
|
||||||
|
return merge(obj, src)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user