Trying to Create a Line Chart

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

clairebennison
Ebase User
Posts: 2
Joined: Sat Dec 10, 2016 9:58 pm

Trying to Create a Line Chart

#1

Postby clairebennison » Sat Dec 17, 2016 1:55 pm

Hi,

I was wondering if anyone can help please? I am a beginner with javascript, jquery etc. and am trying to create a line chart in Ebase. So far I have included jquery and jqplot in my form properties style sheets and scripts. I have created a panel control and in the html element I have put locator id CHART1. In the page control html element I have put the following in the jquery ready event - var plot1 = $.jqplot ('chart1', [[3,7,9,1,5,3,8,2,5]]);
When I run the form no chart appears. Please can anyone help. Ultimately I would like to display a line chart with values read from a table but initially I would just like to display any line chart to get that working correctly.

Thanks

Claire
0 x

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

#2

Postby dvanhussel » Sat Dec 17, 2016 8:40 pm

Hi,

Do you see any errors being logged in the JavaScript console of your browser (F12)?

You seem to use CHART1 and chart1, these values should match as the JavaScript that searches for the element to render de chart in, is case sensitive.

I had some time to spare, so I tried it for my self. :)
This is an export of a form that is backed by an Ebase table, if you change the values, the chart is updated with the new data.

https://1drv.ms/u/s!AvYBj3gw-Ua4g95R0W86AsjReSjrUA (This forum brakes the link to the file on OneDrive so you have to manualy copy/paste it)

You can directly import this file (without unzipping) in the Ebase Designer.(Tools -> Migration -> Import)

If you have any questions about how this works, feel free to ask.

Regards,

David
Last edited by dvanhussel on Mon Dec 19, 2016 2:21 pm, edited 1 time in total.
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#3

Postby Steve James » Mon Dec 19, 2016 2:03 pm

Hi, when you get going PapaParse is a good client side library for sorting out data.

I use it in conjuntion PivotTable (another js libray http://nicolas.kruchten.com/pivottable/examples/)

If you are up to 5.2 then REST is a really simple way of getting data back to the client to render loads of different charts/graphs.

Good luck.
0 x

clairebennison
Ebase User
Posts: 2
Joined: Sat Dec 10, 2016 9:58 pm

#4

Postby clairebennison » Mon Dec 19, 2016 5:21 pm

Hi David,

Thank you so much for your quick response and the example. I loaded it and changed mine to match what you had done and it now works.

Hi Steve,

Thank you for your response too, I'll take a look at that.

Your help is much appreciated

Claire
0 x

Dave
Ebase Staff
Posts: 89
Joined: Mon Sep 10, 2007 11:48 am

#5

Postby Dave » Fri Dec 30, 2016 3:38 pm

Hi Claire - have a look at

http://vault.ebasetech.com/ebase/vaultD ... plotGraphs

You download straight into your Designer if you access the Vault from there.

Dave
0 x


Who is online

Users browsing this forum: No registered users and 38 guests