Hello guys,
I'm working with PieChart, and I give dataSource by props. props data come from API call.
It works, but when I click the legends and I re-click legends the data not appear.
Where I wronge?
The same codice without props works without problem.
here the code:
thank you :)
Hi Alberto,
Greetings from Syncfusion.
We are unable to reproduce the reported scenario. We have created a simple Vue application using the provided code snippet to test the reported scenario and the same can be downloaded from the below link.
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Chart2097340747
Screenshot:
After First legend Click:
Again clicking the legend:
If the reported scenario still persists, please modify the above sample to replicate the reported scenario. It will be helpful for us to analyze further and assist you better.
Regards,
Swetha
Hello,
thank you for the answer.
I know, if I give dataSource from static json(template data, see variables seriesData) it works without problem. But if I give dataSource from props(rest api call from server) the charts has this problem.
Hi Alberto,
We have prepared sample based on your requirement. In the sample, we have accessed data from API response using axios and assigned it to chart series datasource. Chart legend click is working fine our end. We have attached tested sample and video for your reference.
|
mounted () { axios .get('https://api.coindesk.com/v1/bpi/currentprice.json') .then(response => { let data = response.data.bpi; this.seriesData.push( {x: data.EUR.code, y: data.EUR.rate_float}, {x: data.GBP.code, y: data.GBP.rate_float}, {x: data.USD.code, y: data.USD.rate_float} ); }) } |
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/APIcall-211865828.zip
Video : https://www.syncfusion.com/downloads/support/directtrac/general/ze/axios841909138.zip
If you are still facing problem, please try to replicate an issue in above sample or share us issue reproduced sample to validate this case further.
Regards,
Durga Gopalakrishnan.