Build a chart with JSON from javascript

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
amanso
New User
Posts: 7
Joined: Wed Oct 26, 2016 12:45 pm
First Name: Adrián
Last Name: Manso
Company Name: NISA
Contact:

Build a chart with JSON from javascript

Post by amanso »

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.
amanso
New User
Posts: 7
Joined: Wed Oct 26, 2016 12:45 pm
First Name: Adrián
Last Name: Manso
Company Name: NISA
Contact:

Re: Build a chart with JSON from javascript

Post by amanso »

I found a solution!!

The problem was in the order of creation of the elements in the screen . I had to reorder the elements in the tab elements in order to put the inputs I wanted to use before the element chart.Then the javascript function called to generate the JSON to the graf find the needed values.

Best regards.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests