I tried to get the jqxChart example as documented in the wiki to work. I get the error:
Uncaught (in promise) ReferenceError: Chart1_settings is not defined
at Form1.onshow (code.js:19:3)
at Object.preMain (appstudioFunctions.js:2032:69)
Can anyone help?
I’m seeing a problem here too. Looking into it now…
The solution is to run it using Deploy to Local Folder in the Run menu.
Since it’s accessing external resources, it needs to run on a local (or remote) server. Deploy to Local Folder sets one up.
This means, that I cannot use it in a native app on an Android device. So it is worthless for me.
Von meinem/meiner Galaxy gesendet
I just made an native Android app from the sample, and ran it on an Android device. It worked for me.
Why did you expect it not to work?
I get an error when I click Button1:
Uncaught reference error: chart1_settings is not defined.
Von meinem/meiner Galaxy gesendet
No, I do not get an error when I click the button.
Can you give me a detailed step by step to reproduce this?
I copied the Basic code from the sample into Form1 Code area.
I created a Button1 (bs5) and a Chart1 (jqw) in the design area.
I checked no library (only Basic)
My config.sys:
{title}
{description}
Von meinem/meiner Galaxy gesendet
Does the sample itself work for you?
The one in File… Open Sample Project… Basic/jqWidgets/Chart
I will try that, I didn’t it so far
Von meinem/meiner Galaxy gesendet
After Button1 Click it shows no chart, only the text:
‘Demo the jqWidgets chart control. (Basic)’ in the chart’s area
Von meinem/meiner Galaxy gesendet
Can you send me the apk file? I’ll try it here.
apk files cannot be uploaded and my email provider doesn’t allow it too
Thanks - got the file. I’m able to reproduce the problem here now. Looks like a timing problem on startup.
We’ll work on a solution.
Okay, I’m looking forward to use charts. I have some ideas for them.
Von meinem/meiner Galaxy gesendet
Yes, it was a timing issue. The jqxCharts is taking longer to load than it used to: it is not finished before Form1.onshow() is called, so the code there fails.
The solution is easy: when the button is clicked, check if the data has been loaded into the chart. If not, load it:
Function Button1_onclick()
'Render the chart.
If typeof(NSB.jqxSettings["Chart1"].source) = "undefined" Then initGrid()
$("#Chart1").jqxChart(NSB.jqxSettings["Chart1"])
End Function
Function initGrid()
sampleData = []
...
(The show() function has been renamed initGrid() - no other changes were made to it)
Have fun with jqxChart - it’s a powerful control.
Unfortunately, I get an error again (in browser an native app):
Uncaught ReferenceError: Chart1_settings is not defined.
line 28 column 3
Von meinem/meiner Galaxy gesendet
Would you send me your latest apk?
Now I did the changes in the sample project and it works !
It would be nice if it also worked in the browser (F5), then testing the charts would be much easier.
But when I run it in the browser (Chrome) with F5, the error occurs:
Uncaught TypeError: $(…).jqxChart is not a function.
line 8 column 16
Now I integrated the Chart sample into my main app and calling the Butto1_onclick Code results too in the above error:
Uncaught TypeError: $(…).jqxChart is not a function.