Grails Open Flash Chart 0.6 is out!
March 9, 2009, 19:18
Filed under: grails | Tags: , , ,

The new version of Chart Plugin is available.

This version is not compatible with previous versions of plugin, because it’s based on OFC-2 and the others on OFC.

OFC-2 uses JSON to populate the chart:

{“title”:{“text”:”Mon Mar 09 14:56:10 BRT 2009″},”is_decimal_separator_comma”:0,”elements”:[{"values":[9,8,7,6,5,4,3,2,1],”font-size”:10,”type”:”line”}],”num_decimals”:2,

You don’t need to create JSON manually, grails plugin includes a Java API for OFC called jofc2, thats provides a programatically approach to generate the JSON data. The same json above can generate with:

new Chart(new Date().toString())
.addElements(new LineChart()
.addValues(9, 8, 7, 6, 5, 4, 3, 2, 1))

In soon a DSL will be created in plugin to allow creation of charts easily, and you are  free to create your way or use another java library to generate the JSON data.

To install plugin just type:

grails install-plugin ofchart

The use of plugin is extremely easy, first you need to add some resources in you page, in head section put:


So you are ready to put the chart in your page:

<ofchart:chart name=”demo-chart” url=”${ createLink( action: ‘load’ )}” width=”400″ height=”200″/>

Just this, now you are ready to use the open flash chart in your grails applications.

To see a demo, checkout the plugin from svn:

svn checkout ofchart

run with:

grails run-app

And go to:


chat01 chart06 chart05
chart04 chart03 chart02

This is the first version with the OFC2 , so it does not have many features, if you have some suggestion, please open a issue in jira.

For further information about plugin, see the official wiki page.

For information and documentation about jofc2 library see the official web page.

About these ads

21 Comments so far
Leave a comment

Awesome news! Kudos on the release! Did you mention this on the OFC forum? That’s definitely the best place to foster discussion about your 0.6 release.

Comment by Eric Caron

excellent one,
btw is this plugin only for grails 1.1 up ? can i use this on 1.0.4 ?

Comment by adwin

got my thumbs up….

Works a treat….

Trackback by got my thumbs up.

Hi mchiareli , Can I create to 2 axis on Chart in Open Flash Chart 0.6
Because I have big series and small series
I find y_axis_right funtion in , But I can’t use the funtion on grails OFC 0.6

Comment by DANNY

Hi Danny, you want to create a axis in the left and one in the right side?

What kind of chart do you want to use?

Could you send a example?

Comment by mchiareli

I want to use Line chart
like the chart

thank you

Comment by DANNY

is grails’ ofc depends on prototype ?
it seems i need to use it along with my jquery without conflictiong each others

Comment by adwin

Works a treat.

Comment by got my thumbs up.

After deploy my test I have a JSON parse error, in the gsp I put betwen head tag, in a div I put , in a controller I have an action called (load) with
new Chart(new Date().toString())
.addElements(new LineChart()
.addValues(9, 8, 7, 6, 5, 4, 3, 2, 1)), that’s the way or the wrong way?

Comment by crgio

in the head —>
betwen div —>

Comment by crgio

Hi , I want to add click event , exsample

How to coding the API for OFC , thanks

Comment by DANNY

hi danny, the java library jofc2 doesn’t support the click event.

So, you need to create the json manually, or estend the jofc2 to support it.

I was working in a dsl to create the charts with full support to OFC features, but i’m very busy now.


Comment by mchiareli

Can u pls specify the exact steps ,How to to create the json manually

Thanks for your quick reply.

Comment by DANNY

Actually, the click event is supported by jofc2, but it renders incorrect JSON. The simple fix is to do this (assuming ‘c’ references your chart object):

render c.toString().replaceAll(‘key-on-click’, ‘on-click’)

Comment by Ola

I have a strange bug with Stacked Bar Chart Tooltips, can you confirm that?
Seems like it’s a OFC issue anyway…

I have opened a JIRA Issue:

kind regards,

Comment by Flo

Great plugin thanks very much.
I have a questio, how would i set up the wmode parameter?

using the grails tag?


Comment by carlos orrego

Hello there,

this is simply amazing! I love it! :-)

Thanks a lot…


Comment by Giovanni

Is it possible to get the grails source code to add a fix a few things?

Many thanks

Comment by rene


you can checkout from

Comment by mchiareli

Are you using the latest version of OFC2? 28th, July 2009?

Comment by Kevin

[...] I never used Open Flash Charts before and  decided to spend one afternoon and play with it. It was very easy to install and take into use, just by following the short instruction from [...]

Pingback by Uncategorized, technologia, english, Blog / Open Flash Chart 2 on Grails -

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: