tim foran
Posts: 0
Joined: Sun Mar 30, 2014 6:32 am

Plotting data using Amcharts.js libraries

I'm trying to plot data that comes from a REST api call using Amcharts within an HTML component. Before trying to populate with data from my database, I'm just trying to build a sample chart in my app. This does not seem to be working.

I've created a new Javascript for each of the two javascript libraries that are required for the charting. I've then created the HTML component and dropped in the appropriate HTML snippet (I've also tested with a basic snippet that does not call Javascript and it works fine). Then, I set the page to run a javascript snippet on page show and dropped the Javascript for my chart in. After all this, it does not show anything when the page loads.

Any help/thoughts?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Plotting data using Amcharts.js libraries

Hello Tim,

Could you please check browser console http://docs.appery.io/documentation/d...?
Also if doesn't help post the app public link.

tim foran
Posts: 0
Joined: Sun Mar 30, 2014 6:32 am

Plotting data using Amcharts.js libraries

Hi Alena,

The browser console doesn't show any errors. Here's the app public link: http://appery.io/app/mobile-frame?src...

The chart I am trying to display is in the Details page.

Outside of Appery.io, I've successfully used the below html file to display the chart. It might be that I'm just not sure how to break up this file into the HTML and javascript sections for use in Appery.io: Image

tim foran
Posts: 0
Joined: Sun Mar 30, 2014 6:32 am

Plotting data using Amcharts.js libraries

this has been solved! I removed the "AmCharts.ready(function() {" line and the line second from the bottom ( "});" ) and it worked!

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Plotting data using Amcharts.js libraries

Hi Tim.

If given code works, you should to do next steps to get it work in appery.io:

  1. Place HTML component on the page. And set dimensions as "auto". http://prntscr.com/35ohzv/direct

  2. Click "Edit HTML" in the properties. And place here your div with id (like in your working example). http://prntscr.com/35oij0/direct

    precode<div id="chartDiv" style="width: 400px; height: 250px;"><>/code/pre

  3. Add JavaScript "load" event handler and populate it with code http://prntscr.com/35ojuy/direct. http://prntscr.com/35oj8k/direct

    That's all.

    Also you can add "console.log('here is log message')" into the code to see how it works in browser console.

shailesh bhaskaran
Posts: 0
Joined: Mon Aug 25, 2014 3:36 pm

Plotting data using Amcharts.js libraries

I am having a similar problem while trying to add a angular radial gauge chart. I have added the two javascripts needed by amcharts using project-- appsetting.

I am getting following error in the console:
Uncaught TypeError: undefined is not a function startScreen.js:114
randomValue

I have shared the app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a

Would you be able to advise what might be wrong?

Regards Image Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Plotting data using Amcharts.js libraries

Hi Shailesh,

At first i see you forgive " end character for "id" attribute in html. See details: http://prntscr.com/4ghjz2/direct

Basically you need to see in browser console in what line of JS code this error appears.

Also if you share app with us it's necessary to give us it name here.

Regards.

Return to “Issues”