Skip to content
Advertisement

Loop Using Javascript in chart / Echart

i have this object and i need to convert to pie chart (i’am using echart apache)

JavaScript

and this my script to create a chart with real data but always show me the first value from data object (Test1 , 2) i don’t now the problem 🙂

JavaScript

Advertisement

Answer

I don’t know what UserSourceData represents but if you want the datapoints from the data object,you need to run the loop only for the data property within the options object.A map function would do the trick.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement