0

Writing ZK Open Flash Chart Component

asked 2009-05-29 04:17:40 +0800

fselva gravatar image fselva
66 1

updated 2009-05-29 04:18:04 +0800

Hello.
I am writing an Open Flash Chart component integration with ZK (that i want to share with the community). I wrote the view, the handle and so on.
The renderer generate some html code that need access to some javascript files that are in the jar component.
My problem is that the js are not found. I putted in /web/js on the jar. And in the code are referenced with:

<SCRIPT src="/js/json2.js" type="text/javascript"> </SCRIPT>

What am i doing wrong?

Thank's

/fselva

delete flag offensive retag edit

10 Replies

Sort by ยป oldest newest

answered 2009-05-29 19:32:41 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

Hi,

I had start the the exact same job a few days ago. Have you gone how much far?

I've developed a simple wrapper to ofc2, so it can use in zul page like <ofcz id="mychart" width="..." heigth="..." />, is pretty basic, doesn't support a file to load data (the data is loaded dynamically in a java class like mychart.setChartData(String jsonChartData).

It has a few bugs, but in my tests its already usable.

You're willing to implement the ofc chart api? I'm using the jofc2 library for the moment, but not very happy with it.

We could joint efforts on this one.

And for your question, in my impl, I don't use script, I use embed and load the swf (basic copied from Flash component from zk core)

Regards,
Madruga

link publish delete flag offensive edit

answered 2009-05-29 20:32:17 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2009-05-29 20:32:33 +0800

Charting is a thing that is missing in my zk sample application.

If i can help , please let me know.

regards
Stephan

PS: Is this compatible with JFreeChart ?

link publish delete flag offensive edit

answered 2009-05-31 02:39:17 +0800

fselva gravatar image fselva
66 1

Madruga:
I have the aproach like yours (chart.setData(jsondata)). When i get this running i'll implement the jfc api. I am using the jfc2 too. I like the results you can get.
How do you embeded the flash swf file? You don't need the json2.js, swfobject.js, etc?
I use all my stuff in a java way. How you implemented the zul tags?
Thanks

Stephan:
What about your sample application? We can make some sample charts you can put in it.
My idea is to make the use of the component, very similar to the use of JFreeChart in zk. So you can select, for example, a bar chart implemented as JFreeChart or as Open Flash Chart, using the model and properties assigned.
Thanks

Fernando

link publish delete flag offensive edit

answered 2009-05-31 16:45:25 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

@fselva,

yes, that's no problem to put charts in it. We must only think about it what data are shown.

Stephan
https://62.75.171.30/test/
admin/admin

link publish delete flag offensive edit

answered 2009-06-01 01:25:55 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

@Stephan compatibility with JFreeChart wil be limited by ofc because JFreeChart has much more chart types (like gant, wind, candle, etc). OFC currently has only line, bar, pie and radar. The interesting of OFC is that is in flash, so it's more interactive and more beautiful (in my opinion).

@Fernando I embed only the swf from ofc and for now I have one zul tag only (<ofcz ... />), but I've done some testing today and it's a little buggy, sometimes works, sometimes not, missing something related with JS probably.

I've made the source available via bitbucket here
So you can take a look at my implementation.
But it would be really nice if you (and you too Stephan) created a account at bitbucket so we could join efforts on this component.

Regards,
Madruga

link publish delete flag offensive edit

answered 2009-06-01 19:15:18 +0800

fselva gravatar image fselva
66 1

Madruga:
I'll take a look of your project and bitbucket (i don't know that) to create an account.

Regards

Fernando

link publish delete flag offensive edit

answered 2009-06-01 23:27:48 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

add my wlm/gtalk if u want, omadruga at gmail

link publish delete flag offensive edit

answered 2009-06-09 17:04:34 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

Hi all,

I've fixed all the bugs, and released a RC version of ofcz zk plugin for Open Flash Chart.
Download here.
Simple wiki here.

@Stephan: Congratulations for your demo app, it's quite beautiful. I was thinking about creating some examples of usage ofcz + jofc2 to put on the wiki, but would be nice if we could generate the example with some "real" word data from your demo app, and also put the charts on your app, what do you think about?

Regards,
Madruga
Madruga

link publish delete flag offensive edit

answered 2009-06-09 20:30:05 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2009-06-09 20:47:30 +0800

@madruga
@fselva

Yes, that would be nice.

1. All data in the sample app can be created from a script. So it's no problem if something crashed.
2. Over the basic 27 customers. We have a test-data routine that created 10.000 customers at a run.
At time there are about 120.000 records.
3. Think about of a chart which shows a diagram of the customers percentage 'city' or 'branch' because they are randomned created.

7. Next days, i'll update to 3.6.2

regards
Stephan

PS: Please contact me under sge(at)forsthaus(dot)de

link publish delete flag offensive edit

answered 2009-06-29 17:02:42 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

I've relased version 0.2 of OFCZ which fixes a major bug.

download it here

also there is a new line chart example using jofc2 API - view it here

best regards,
Madruga

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-05-29 04:17:40 +0800

Seen: 1,393 times

Last updated: Jun 29 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More