zingchart / zingchart-vue

A Vue component to create charts with ZingChart
https://www.zingchart.com/docs/integrations/vue
MIT License
26 stars 5 forks source link

Zingchart method(s) missing #18

Closed MarcoLazzoni closed 7 months ago

MarcoLazzoni commented 3 years ago

Using zingchart-vue as explained in the readme I noticed that the method 'getlabelinfo' from zingchart docs (https://www.zingchart.com/docs/api/methods#getlabelinfo) is not part of the zingchart vue component.

Checking this repo's examples I found out that in this instance is all good, but still it's missing from other examples of zingchart-vue usage (i.e. https://codesandbox.io/s/ms7ml, changing the code to try and call 'getlabelinfo' from the component shows a missing function error).

antonioreyna commented 3 years ago

did you solve it?

lasabahebwa commented 7 months ago

@MarcoLazzoni @antonioreyna All zingchart methods are readily available on the component's instance to call. For example, to add get a label's information from the chart:

function getLabelInfo() {
  let output = chart.value.getlabelinfo({
    id: 'demoLabel'
  })

  console.log(output)
}

<ZingChartVue ref="chart" :data="chartData" />

<button class="primary" @click="getLabelInfo">Get Label Info</button>

Please use this demo for reference. You need to install dependencies with npm install and the npm run dev to see the demo in the browser. gli