Currently, I am attempting to establish a connection with a remote server's REST API in order to retrieve some valuable data. This information will then be utilized in an Angular2 LineChart.
I have successfully obtained the JSON file and converted it into a custom Interface.
The interface was created using Json2ts.com
https://i.sstatic.net/a0YHW.png
Here are my Constructor and LineChart Variables which need to be filled with the JSON Data. In the constructor, I convert the JSON result into my Interface Type: RootObject. When I print the JSON value in the console, it is valid.
https://i.sstatic.net/mvFq6.png
However, I am unable to assign a value from the data gathered from the JSON File, resulting in an error message stating 'Cannot read property 'linechart' of undefined.'
https://i.sstatic.net/70wKr.png
The issue lies in my inability to set a class data variable from the constructor or directly input the data into the chart. Is there a method to resolve this?
Any assistance provided would be greatly appreciated.