vue-orgchart icon indicating copy to clipboard operation
vue-orgchart copied to clipboard

How to change options after chart is rendered?

Open mad-coder-365 opened this issue 7 years ago • 0 comments

Hi,

I am trying to create a chart with zoom and pan which is initially set to false.

<vo-edit :data="chartData" :pan="isPanAllowed" :zoom="isZoomAllowed"></vo-edit>

data() { return { isPanAllowed: false, isZoomAllowed: false }; },

I have a checkbox that toggles these values: <input type="checkbox" v-model="isPanAllowed"> <input type="checkbox" v-model="isZoomAllowed"> But this is not updating chart options.

I even tried something like watch: { isZoomAllowed: { handler(isZoomAllowed) { this.orgchart.setOptions('zoom', isZoomAllowed); } } } But I get error TypeError: this.orgchart.setOptions is not a function

Is there any way to do something like this in vue (https://codepen.io/dabeng/pen/KMKaRY) $('#toggleZoom').on('click', function() { oc.setOptions('zoom', this.checked); });

mad-coder-365 avatar Jul 04 '18 04:07 mad-coder-365