fusioncharts / angular-fusioncharts

Angular Component for FusionCharts JavaScript Charting Library
https://fusioncharts.github.io/angular-fusioncharts/#/ex1
Other
55 stars 37 forks source link

Cannot assign to read only property '6' of string XX #90

Closed GuysmoB closed 2 years ago

GuysmoB commented 3 years ago

Hi,

I use FusionChart with Angular 10 for candlestick chart. I have a CSV file where each data (high, open, close ...) are extracted. I have an error in createDataTable() : ERROR Error: Uncaught (in promise): TypeError: Cannot assign to read only property '6' of string '2007-01-02' TypeError: Cannot assign to read only property '6' of string '2007-01-02'

I started with the example given in a tutorial but I struggle to pass data in a correct format I guess. At start, data are fetch from a server. See the tutorial : https://www.fusioncharts.com/fusiontime/examples/interactive-candlestick-chart?framework=angular4

app.component - Copie.txt Any idea ? Thank you :)

AyanBhadury commented 3 years ago

Hi,

Here is a working demo fetching data from an external CSV file - https://codesandbox.io/s/csv-angular-demo-wid6v

Hope this helps.

GuysmoB commented 3 years ago

Thank you @AyanBhadury, I'll check it !

GuysmoB commented 3 years ago

I got it to work on my project ! It seems the .map() method did the trick but I don't understand why. Can you explain me please @AyanBhadury ?

Thank again :)

AyanBhadury commented 2 years ago

@GuysmoB for array.mapmethod refer to this page : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map