We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Is it possible to subscribe to populate a chart with an object that was assembled from a JSON object?


I am trying to implement two charts: a column chart and a drilldown pie chart.

I would be parsing out data for the charts from larger JSON objects that are returned from services.

I can get the args.dataSource in the load function of the column chart to populate with the correct data but the chart doesn't render. I have yet to try remote data with the pie chart.

Any help would be greatly appreciated.

Thank you,

P.S. I do not use VSCode so if you have the time to provide a sample, would it be possible to link to a Stackblitz example or just show the code here? Many, many thanks.

3 Replies

DD Dharanidharan Dharmasivam Syncfusion Team March 25, 2019 06:45 AM UTC

Hi Elise, 
Greetings from Syncfusion.  
We have analyzed your query. You can pass the json data to chart in the load event as an array of object and the chart will render properly. We have prepared a column chart sample according to this requirement. 
Also, kindly find the sample for binding remote data to chart. Here we have used the data manager to fetch the data from server and bind to chart. This can be changed based on your scenario. And kindly find the sample for drilldown with pie chart. 
If you still face any issues in binding json data to chart, kindly revert us by modifying the sample or provide your sample with replication steps to replicate the reported scenario. 

ER Elise Rothberg March 29, 2019 10:02 PM UTC

Thanks but I am using data that has been fetched previously from two different service calls so that won't work.

I did discover that wrapping the entire div in an *ngIf that looks to see if the chart data was received works.

BP Baby Palanidurai Syncfusion Team April 1, 2019 09:31 AM UTC

Hi Elise,

Thanks for your update,

Please let us know if you need any further assistance on this.


Live Chat Icon For mobile
Up arrow icon