import { LinePod } from '..'; import { VueChartwerkPodMixin } from '@chartwerk/core'; // it is used with Vue.component, e.g.: Vue.component('chartwerk-line-pod', VueChartwerkLinePod) export const VueChartwerkLinePod = { // alternative to `template: '
'` 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(); } } };