Build a chart with JSON from javascript
Posted: Tue Sep 05, 2017 6:14 am
HI,
I want to fill a chart from the result of a javascript, but i have problems.
I build the JSON correctly with the javascript function and I have tried different ways to charge this JSON in the chart but always fail.
First way:
I binded a program field to chart json property, and i used the custom formatting and in the custom javascript function I wrote the name of my function. This could be the best solution, but when the function is launched the screen is reloading (this property is executed in the moment the screen is rewritten) and the input fields that i use in my javascript function are not available and I can't build my JSON.
Other way I tried was, in the moment i have the data needed to buld the JSON, I make it, and I save the JSON in an input field. In addition I put in the property chart JSON of the chart the code: script: get("formate") , being formate the id of the input with th JSON, but it's not working neither.
I expect somebody helps me to find a solution.
I want to fill a chart from the result of a javascript, but i have problems.
I build the JSON correctly with the javascript function and I have tried different ways to charge this JSON in the chart but always fail.
First way:
I binded a program field to chart json property, and i used the custom formatting and in the custom javascript function I wrote the name of my function. This could be the best solution, but when the function is launched the screen is reloading (this property is executed in the moment the screen is rewritten) and the input fields that i use in my javascript function are not available and I can't build my JSON.
Other way I tried was, in the moment i have the data needed to buld the JSON, I make it, and I save the JSON in an input field. In addition I put in the property chart JSON of the chart the code: script: get("formate") , being formate the id of the input with th JSON, but it's not working neither.
I expect somebody helps me to find a solution.