mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 18:00:20 +00:00
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
This commit is contained in:
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
|
||||
export default Vue.extend({
|
||||
template: `
|
||||
<div>
|
||||
<canvas id="{{chartId}}" width="{{width}}" height="{{height}}" v-el:canvas></canvas>
|
||||
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -49,11 +49,11 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
methods: {
|
||||
render (data, options) {
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
|
||||
this._chart = new Chart(
|
||||
this.$els.canvas.getContext('2d'), {
|
||||
this.$refs.canvas.getContext('2d'), {
|
||||
type: 'bar',
|
||||
data: data,
|
||||
options: chartOptions
|
||||
|
||||
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
|
||||
export default Vue.extend({
|
||||
template: `
|
||||
<div>
|
||||
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -27,16 +27,33 @@ export default Vue.extend({
|
||||
data () {
|
||||
return {
|
||||
defaultOptions: {
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
},
|
||||
gridLines: {
|
||||
display: false
|
||||
}
|
||||
}],
|
||||
xAxes: [ {
|
||||
gridLines: {
|
||||
display: false
|
||||
},
|
||||
categoryPercentage: 0.5,
|
||||
barPercentage: 0.2
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
render (data, options) {
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
|
||||
this._chart = new Chart(
|
||||
this.$els.canvas.getContext('2d'), {
|
||||
this.$refs.canvas.getContext('2d'), {
|
||||
type: 'bubble',
|
||||
data: data,
|
||||
options: chartOptions
|
||||
|
||||
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
|
||||
export default Vue.extend({
|
||||
template: `
|
||||
<div>
|
||||
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -32,11 +32,11 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
methods: {
|
||||
render (data, options) {
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
|
||||
this._chart = new Chart(
|
||||
this.$els.canvas.getContext('2d'), {
|
||||
this.$refs.canvas.getContext('2d'), {
|
||||
type: 'doughnut',
|
||||
data: data,
|
||||
options: chartOptions
|
||||
|
||||
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
|
||||
export default Vue.extend({
|
||||
template: `
|
||||
<div>
|
||||
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -47,11 +47,11 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
methods: {
|
||||
render (data, options) {
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
|
||||
this._chart = new Chart(
|
||||
this.$els.canvas.getContext('2d'), {
|
||||
this.$refs.canvas.getContext('2d'), {
|
||||
type: 'line',
|
||||
data: data,
|
||||
options: chartOptions
|
||||
|
||||
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
|
||||
export default Vue.extend({
|
||||
template: `
|
||||
<div>
|
||||
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -32,11 +32,11 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
methods: {
|
||||
render (data, options) {
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
|
||||
this._chart = new Chart(
|
||||
this.$els.canvas.getContext('2d'), {
|
||||
this.$refs.canvas.getContext('2d'), {
|
||||
type: 'pie',
|
||||
data: data,
|
||||
options: chartOptions
|
||||
|
||||
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
|
||||
export default Vue.extend({
|
||||
template: `
|
||||
<div>
|
||||
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -32,11 +32,11 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
methods: {
|
||||
render (data, options) {
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
|
||||
this._chart = new Chart(
|
||||
this.$els.canvas.getContext('2d'), {
|
||||
this.$refs.canvas.getContext('2d'), {
|
||||
type: 'polarArea',
|
||||
data: data,
|
||||
options: chartOptions
|
||||
|
||||
@@ -5,7 +5,7 @@ import { mergeOptions } from '../helpers/options'
|
||||
export default Vue.extend({
|
||||
template: `
|
||||
<div>
|
||||
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -32,11 +32,11 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
methods: {
|
||||
render (data, options) {
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
|
||||
this._chart = new Chart(
|
||||
this.$els.canvas.getContext('2d'), {
|
||||
this.$refs.canvas.getContext('2d'), {
|
||||
type: 'radar',
|
||||
data: data,
|
||||
options: chartOptions
|
||||
|
||||
@@ -20,15 +20,7 @@
|
||||
import BubbleExample from './BubbleExample'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BarExample,
|
||||
LineExample,
|
||||
DoughnutExample,
|
||||
PieExample,
|
||||
RadarExample,
|
||||
PolarAreaExample,
|
||||
BubbleExample
|
||||
}
|
||||
components: { BarExample, LineExample, DoughnutExample, PieExample, RadarExample, PolarAreaExample, BubbleExample }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import BarChart from '../BaseCharts/Bar'
|
||||
|
||||
export default BarChart.extend({
|
||||
ready () {
|
||||
this.render({
|
||||
mounted () {
|
||||
this.renderChart({
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||
datasets: [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import BubbleChart from '../BaseCharts/Bubble'
|
||||
|
||||
export default BubbleChart.extend({
|
||||
ready () {
|
||||
this.render({
|
||||
mounted () {
|
||||
this.renderChart({
|
||||
datasets: [
|
||||
{
|
||||
label: 'Data One',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import DoughnutChart from '../BaseCharts/Doughnut'
|
||||
|
||||
export default DoughnutChart.extend({
|
||||
ready () {
|
||||
this.render({
|
||||
mounted () {
|
||||
this.renderChart({
|
||||
labels: ['VueJs', 'EmberJs', 'ReactJs', 'AngularJs'],
|
||||
datasets: [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import LineChart from '../BaseCharts/Line'
|
||||
|
||||
export default LineChart.extend({
|
||||
ready () {
|
||||
this.render({
|
||||
mounted () {
|
||||
this.renderChart({
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import PieChart from '../BaseCharts/Pie'
|
||||
|
||||
export default PieChart.extend({
|
||||
ready () {
|
||||
this.render({
|
||||
mounted () {
|
||||
this.renderChart({
|
||||
labels: ['VueJs', 'EmberJs', 'ReactJs', 'AngularJs'],
|
||||
datasets: [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import PolarAreaChart from '../BaseCharts/PolarArea'
|
||||
|
||||
export default PolarAreaChart.extend({
|
||||
ready () {
|
||||
this.render({
|
||||
mounted () {
|
||||
this.renderChart({
|
||||
labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
|
||||
datasets: [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import RadarChart from '../BaseCharts/Radar'
|
||||
|
||||
export default RadarChart.extend({
|
||||
ready () {
|
||||
this.render({
|
||||
mounted () {
|
||||
this.renderChart({
|
||||
labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
|
||||
datasets: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user