Dynamic fusion chart

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
aa73
New User
Posts: 19
Joined: Fri Aug 23, 2019 5:13 am
First Name: Alexis
Last Name: ALABERT
Company Name: LOISELET & DAIGREMONT
Country: France
Contact:

Dynamic fusion chart

Post by aa73 »

Hello,

In my project, I use a slider, a text box and a fusion chart (angulargauge)

When I move the slider, I would like the value of the fusion chart to change.
In the OnChange property of the slider, I put this code :
changeElementValue ("TextBox1", get ("Slider1")); // to see the value of the slider

var res = get ("Slider1");
var test = "{\" chart \ ": {\" caption \ ": \" Project progress \ ", \" subcaption \ ": \" \ ", \" lowerLimit \ ": \" 0 \ ", \ "upperLimit \": \ "100 \", \ "lowerLimitDisplay \": \ "Start \", \ "upperLimitDisplay \": \ "End \", \ "showValue \": \ "1 \", \ "valueBelowPivot \ ": \" 1 \ ", \" theme \ ": \" fusion \ "}, \" colorRange \ ": {\" color \ ": [{\" minValue \ ": \" 0 \ ", \ "maxValue \": \ "50 \", \ "code \": \ "# e44a00 \"}, {\ "minValue \": \ "50 \", \ "maxValue \": \ "75 \", \ "code \": \ "# f8bd19 \"}, {\ "minValue \": \ "75 \", \ "maxValue \": \ "100 \", \ "code \": \ "# 6baa01 \ "}]}, \" dials \ ": {\" dial \ ": [{\" value \ ": \" ";
var test2 = "\"}]}} ";
var test3 = test + res + test2;
console.log (test3);
applyProperty ("Chart1", "chart json", test3);
applyProperty ("Chart1", "widget type", "chart");
The problem is, if I move the slider too fast, the chart displays "Loading Graph ...".

What property should I use to update the chart only when I have finished moving the slider?

Thanks for you answer
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Dynamic fusion chart

Post by Scott Klement »

The slider doesn't have any way to know when you are done moving it. You would have to determine your own logic that detects when you are done with the slider, there's nothing built-in. Sorry.

Have you considered using JavaScript's JSON.stringify() routine to build your JSON instead of manually building it in a character string? I think that'd make your code much easier to read.
aa73
New User
Posts: 19
Joined: Fri Aug 23, 2019 5:13 am
First Name: Alexis
Last Name: ALABERT
Company Name: LOISELET & DAIGREMONT
Country: France
Contact:

Re: Dynamic fusion chart

Post by aa73 »

Hi,

Thanks for your awnser.
I think I have no choice, i have to add a button to change the chart

I'm not a specialist of Javascript.
What is "JSON.stringify() routine" ?
Post Reply

Who is online

Users browsing this forum: Esdale and 1 guest