3 changed files with 35 additions and 33 deletions
@ -0,0 +1,33 @@
|
||||
import { LinePod } from '..'; |
||||
import { VueChartwerkPodMixin } from '@chartwerk/core'; |
||||
|
||||
// it is used with Vue.component, e.g.: Vue.component('chartwerk-line-pod', VueChartwerkLinePod)
|
||||
export const ChartwerkLinePod = { |
||||
// alternative to `template: '<div class="chartwerk-line-pod" :id="id" />'`
|
||||
render(createElement) { |
||||
return createElement( |
||||
'div', |
||||
{ |
||||
class: { 'chartwerk-line-pod': true }, |
||||
attrs: { id: this.id } |
||||
} |
||||
); |
||||
}, |
||||
mixins: [VueChartwerkPodMixin], |
||||
methods: { |
||||
render() { |
||||
if(this.pod === undefined) { |
||||
this.pod = new LinePod(document.getElementById(this.id), this.series, this.options); |
||||
this.pod.render(); |
||||
} else { |
||||
this.pod.updateData(this.series, this.options); |
||||
} |
||||
}, |
||||
renderSharedCrosshair(values) { |
||||
this.pod.renderSharedCrosshair(values); |
||||
}, |
||||
hideSharedCrosshair() { |
||||
this.pod.hideSharedCrosshair(); |
||||
} |
||||
} |
||||
}; |
Loading…
Reference in new issue