Charts within Servoy

Questions and answers on developing, deploying and using plugins and JavaBeans

Charts within Servoy

Postby marco.rossi » Thu Mar 31, 2016 3:27 pm

Hi all,

I'd like to use charts within Servoy.
I know about Google Charts (with Velocity) and other standard charts but they are neither really
nice nor functional.

I'd like to use stunning charts written entirely in javascript (there are thousands of them).

So my question is:
Does exist a way or a swing component to embed charts written in javascript?
I suppose that it's necessary to import also others libraries (often included within a web-broswer).

Servoy normally use Rhino to embed javascript in Java (Does the version 8 use Nashorn?)
but I don't really know how (expecially how to use it at will).

Any suggestion?

Regards
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 36
Joined: Sun Apr 12, 2015 9:33 pm

Re: Charts within Servoy

Postby Andrei Costescu » Thu Mar 31, 2016 4:01 pm

In ng client ( Servoy 8 ) - that runs inside the browser - you can wrap those stunning chart libraries into servoy web components.
Then you can use them in your form just like any other component. I did see some used already - also played with a chart library once.

Don't know if someone has already a complete library wrapped like that (for ng client) - but you can still do it yourself for the components you need.

I know there are plugins for web-client (webclientutils) as well to work at a lower level with the browser, also you could wrap them as wicket beans, but I prefer ng for this sort of thing.
If you really want smart-client I know there are ways to integrate browsers into it - and you could still show the chart inside the browser: JFXPanel or the browser plugin.

Maybe someone who really did something like that can contribute.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 902
Joined: Tue Jun 26, 2007 3:14 pm

Re: Charts within Servoy

Postby Manolo_Etec » Fri Apr 01, 2016 9:36 am

Manuel López
Etec Programación SL
[email protected]
http://www.etecsoft.com

Servoy 8.0.2
Windows 10
Yesterday: Java 8-25
Manolo_Etec
 
Posts: 56
Joined: Fri Sep 12, 2008 3:58 pm

Re: Charts within Servoy

Postby paronne » Fri Apr 01, 2016 11:26 am

Which type of Servoy client are you targeting ? Smart Client, Web Client or NGClient ?
The approach for implementing what you are asking would change depending on what you are looking for.
The java fx proposed by Manuel for instance should be used for Smart Client only. would allow you to use Javascript libs into a Java Fx Web View (you can say is the equivalent of using an HTML Area in Web Client to render charts based in third party libraries).
Do you know already which chart library you would like to use ?
paronne
 
Posts: 85
Joined: Fri Nov 02, 2012 3:21 pm

Re: Charts within Servoy

Postby juan.cristobo » Mon Apr 04, 2016 10:26 am

I've implemented Google Charts in Web Client:

viewtopic.php?f=15&t=19995#p107716
Juan
Madrid (Spain)

Servoy 7.4.x - MySQL / SQL Server 2008-2016
Windows 10 Pro
juan.cristobo
 
Posts: 178
Joined: Thu Apr 19, 2012 9:12 am

Re: Charts within Servoy

Postby marco.rossi » Mon Apr 04, 2016 11:22 am

Andrei, Manuel, Paronne and Juan:
Thank you all for your replies.
I'll respond per person.

Andrei:
I'm already able to use charts within the browser (webclient). I'm trying to maintain the full portability of the solution (so both smart and webclient).
This is because I was asking for a swing component.
You talk about
"the browser plugin"
. Where I can found it?

Manuel:
Thank you Manuel. I've already used JFX in the past but I'd forgotten it. Thank you for remind it to me. I'll try this solution.

Paronne:
As wrote for Andrei, I'm looking for a smarclient component (swing) to do the job. I don't know yet about the full dependencies necessary to run those charts.
While I was looking for a swing component on the web, I've found this: https://www.teamdev.com/jxbrowser. Needs for licence, but I want share it with you all.

Juan:
Thanks for your reference. I was looking for something different (I would solve the problem to use a JavaScript-based Chart within the smartclient).

Thank you all again. I'll try on to solve the problem with JFX.

Regards
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 36
Joined: Sun Apr 12, 2015 9:33 pm

Re: Charts within Servoy

Postby paronne » Mon Apr 04, 2016 12:02 pm

Hi Marco,

if you are looking for a solution which can work for both Smart Client and Web Client you need a code base that can handle the svyJFXWebView for the web client and an HTML Area in the Web Client.
There is a servoy open sourced module, 'svyComponent' available in GitHub, which would allow you to wrap yout charts in a module that can be used both in Smart Client and Web Client from a single code base. I should warn you that implementing such solution with svyComponent is complex and time consuming, is not recommanded to be used without proper support. Also this module is deprecated for the NGClient, it can be considered as a primitive solution to implementat reusable Web Components.

Regards,
Paolo
paronne
 
Posts: 85
Joined: Fri Nov 02, 2012 3:21 pm

Re: Charts within Servoy

Postby marco.rossi » Mon Apr 04, 2016 3:51 pm

Hi Paolo,

thank you for your reply.

I've tried to use svyJFXWebView but it crash with any URL.

My test environment:
windows 10, Java 1.8.60, servoy 7.4.6

Step:

1 - I've downloaded the latest version
2 - I've downloaded the svyJFXWebView_test
3 - I've removed from the "test" solution a dependency from the "unitTest" solution
4 - I've launched the test solution.
5 - I've submitted an URL and pushed Return.

Here a sample to reproduce the problem:
test_JFX.servoy
(86.61 KiB) Downloaded 35 times


Regards
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 36
Joined: Sun Apr 12, 2015 9:33 pm

Re: Charts within Servoy

Postby paronne » Mon Apr 04, 2016 4:07 pm

Hi Marco,

do you get any error in console ? your test solution runs fine for me. The problem may be related to the Java version you are using.
If you want to try it with a different java version you can force Servoy developer to use a specific java version by defining the java path in the servoy.ini file:

-vm
C:/Program Files/Java/jdk1.7.0_45/jre/bin
--launcher.XXMaxPermSize
....
paronne
 
Posts: 85
Joined: Fri Nov 02, 2012 3:21 pm

Re: Charts within Servoy

Postby marco.rossi » Tue Apr 05, 2016 6:04 pm

Hi Paolo,

I don't get any error within console but I found a trace of an error here:
hs_err_pid11868.txt
(42.83 KiB) Downloaded 41 times


The original file name had extension ".log" (renamed because servoy forum rules).

Hope this help.

I'll try also to install the version of java you have indicated.

Regards
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 36
Joined: Sun Apr 12, 2015 9:33 pm

Re: Charts within Servoy

Postby marco.rossi » Thu Apr 07, 2016 6:32 pm

Dear Paolo,

I've tried also with Java 7.79 but it crash.

Here the report
hs_err_pid13388.txt
(41.89 KiB) Downloaded 41 times


Looking on the web (for "Failed to write core dump. Minidumps are not enabled by default on client versions of Windows", the message within the log)
I've found that it could be a problem that target pc with dedicated graphic card.

I try tomorrow on a computer with only a bounded graphic card.

Could be that the problems?
If yes: could it be managed?

Regards
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 36
Joined: Sun Apr 12, 2015 9:33 pm

Re: Charts within Servoy

Postby marco.rossi » Wed Jun 29, 2016 10:46 am

For anyone who had the same problem (svyJFXWebView_test crash while using), I've solved with a new Servoy installation.
Probably update after update something was not working properly.

Regards
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 36
Joined: Sun Apr 12, 2015 9:33 pm


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 3 guests

cron