Skip to content

Commit 21267c4

Browse files
committed
add new method - appendSeries
1 parent b64a26a commit 21267c4

File tree

6 files changed

+62
-23
lines changed

6 files changed

+62
-23
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
example/node_modules/

.eslintrc.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
ecmaVersion: 2018,
5+
parser: 'babel-eslint',
6+
sourceType: 'module'
7+
},
8+
env: {
9+
browser: true,
10+
es6: true,
11+
node: true
12+
},
13+
// extends: ['plugin:prettier/recommended'],
14+
globals: {
15+
"ApexCharts": true
16+
},
17+
rules: {
18+
// Remove this when prettier 2.0 is out
19+
'space-before-function-paren': 0 // Do not clash with Prettier
20+
}
21+
};

.vscode/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
// Temporary until prettier and eslint are correctly setup
3+
"editor.formatOnSave": false
4+
}

dist/vue-apexcharts.js

+3
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@
9595
updateSeries: function updateSeries(newSeries, animate) {
9696
this.chart.updateSeries(newSeries, animate);
9797
},
98+
appendSeries: function appendSeries(newSeries, animate) {
99+
this.chart.appendSeries(newSeries, animate);
100+
},
98101
updateOptions: function updateOptions(newOptions, redrawPaths, animate) {
99102
this.chart.updateOptions(newOptions, redrawPaths, animate);
100103
},

src/ApexCharts.component.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,28 @@ export default {
2121
default: 'auto'
2222
}
2323
},
24-
data() {
24+
data () {
2525
return {
2626
chart: null
2727
}
2828
},
29-
mounted() {
29+
mounted () {
3030
this.init()
3131
},
3232
created () {
3333
this.$watch('options', options => {
3434
if (!this.chart && options) {
3535
this.init()
3636
} else {
37-
this.chart.updateOptions(this.options);
37+
this.chart.updateOptions(this.options)
3838
}
3939
})
4040

4141
this.$watch('series', series => {
4242
if (!this.chart && series) {
4343
this.init()
4444
} else {
45-
this.chart.updateSeries(this.series);
45+
this.chart.updateSeries(this.series)
4646
}
4747
}, { deep: true })
4848

@@ -53,17 +53,17 @@ export default {
5353
})
5454
})
5555
},
56-
beforeDestroy() {
56+
beforeDestroy () {
5757
if (!this.chart) {
5858
return
5959
}
6060
this.destroy()
6161
},
62-
render(createElement) {
63-
return createElement('div');
64-
},
62+
render (createElement) {
63+
return createElement('div')
64+
},
6565
methods: {
66-
init() {
66+
init () {
6767
const newOptions = {
6868
chart: {
6969
type: this.type,
@@ -73,45 +73,45 @@ export default {
7373
series: this.series
7474
}
7575

76-
const config = ApexCharts.merge(this.options, newOptions);
76+
const config = ApexCharts.merge(this.options, newOptions)
7777
this.chart = new ApexCharts(this.$el, config)
7878
this.chart.render()
7979
},
80-
refresh() {
80+
refresh () {
8181
this.destroy()
8282
this.init()
8383
},
84-
destroy() {
84+
destroy () {
8585
this.chart.destroy()
8686
},
87-
updateSeries(newSeries, animate) {
87+
updateSeries (newSeries, animate) {
8888
this.chart.updateSeries(newSeries, animate)
8989
},
90-
updateOptions(newOptions, redrawPaths, animate) {
90+
updateOptions (newOptions, redrawPaths, animate) {
9191
this.chart.updateOptions(newOptions, redrawPaths, animate)
9292
},
93-
toggleSeries(seriesName) {
93+
toggleSeries (seriesName) {
9494
this.chart.toggleSeries(seriesName)
9595
},
96-
appendData(newData) {
96+
appendData (newData) {
9797
this.chart.appendData(newData)
9898
},
99-
addText(options) {
99+
addText (options) {
100100
this.chart.addText(options)
101101
},
102-
dataURI() {
103-
return this.chart.dataURI();
102+
dataURI () {
103+
return this.chart.dataURI()
104104
},
105-
addXaxisAnnotation(options, pushToMemory) {
105+
addXaxisAnnotation (options, pushToMemory) {
106106
this.chart.addXaxisAnnotation(options, pushToMemory)
107107
},
108-
addYaxisAnnotation(options, pushToMemory) {
108+
addYaxisAnnotation (options, pushToMemory) {
109109
this.chart.addYaxisAnnotation(options, pushToMemory)
110110
},
111-
addPointAnnotation(options, pushToMemory) {
111+
addPointAnnotation (options, pushToMemory) {
112112
this.chart.addPointAnnotation(options, pushToMemory)
113113
},
114-
clearAnnotations() {
114+
clearAnnotations () {
115115
this.chart.clearAnnotations()
116116
}
117117
}

0 commit comments

Comments
 (0)