chartArea of PieChart not supported by Visualizations for Vaadin?

Google recently added some new features to the
PieChart visualization component
and the chartArea configuration option is something I’ve been waiting for. What I’m trying to do is to fit a pie chart in a relatively small space which (I think) isn’t possible at the moment because the chart has way too large margins.


Installed versions:

Visualizations for Vaadin: 1.1.1
GWT Visualization: 1.1.0
Vaadin: 6.4.8

These are the commands I’ve tried so far without success:

pieChart.setOption("chartArea", "{left:0,top:0,width:50,height:75}");
pieChart.setOption("chartArea.left", 0);
pieChart.setOption("chartArea.top", 0);

I also tried to set the chartArea properties as String, set higher values and to recompile the widgetsets.

Is this even related to Visualizations for Vaadin or could the problem be somewhere else?

We also have that problem in our project. I saw the org.vaadin.vaadinvisualizations.widgetset.client.ui.VPieChart setting the option size to 200x200 in the createOptions() method.

I’ve tried all kind of approaches, but can’t get it to work… Latest attempt was

chart.setOption("chartArea", "left:10,top:10,width:435,height:200");

Any thoughts?

Thanks

Since this is something we need, I’ve added support for corecharts and the ChartArea options to the VisualizationForVaadin addon.

When I run the VisualizationForVaadin project and test the new functionality, everything works fine. I then selected “Export” on the project and exported it as a Vaadin Add-On. After that, I use this new jar in my project and can set the new options in the Java code.


Problem

After I start the application with Maven and open the debug window, I see that my new widget client code is not executed.

Does anybody have a suggestion?

In case you simply copied the JAR to the project, Maven will not use it. All dependencies must come via the Maven dependency mechanism, so you need to e.g. install the file into your local Maven repository with “mvn install:install-file …” (quite a few options if it was not a Maven project, including -DgeneratePom=true).

Then recompile the widgetset with the usual commands, e.g. “mvn clean compile vaadin:update-widgetset gwt:compile”. Check that your widget is listed in compilation log.

Finally, make sure the compiled widgetset is in a location where the server can find it, and there is no old cached copy etc.

I did install the file to my local maven repo and added its dependency to the pom.

After running all the commands, I get the following *.nocache.js files. I wonder if I need one for my widgetset plus one for the add-on and its dependencies?!

./src/main/webapp/VAADIN/widgetsets/com.abc.client.widgetset.AbcWidgetSet/com.abc.client.widgetset.AbcWidgetSet.nocache.js
./target/abc-client-1.0-SNAPSHOT/VAADIN/widgetsets/com.abc.client.widgetset.AbcWidgetSet/com.abc.client.widgetset.AbcWidgetSet.nocache.js

I’ve cleared the browser cache, but can’t see the add-on changes.

Getting some sleep and looking into it tomorrow.

Hi all,

Good news. I’ve patched the VisualisationsForVaadin (http://vaadin.com/directory#addon/visualizationsforvaadin) add-on to support corecharts and chartArea options.

Please find my patch attached and let me know if you have any problems, I’ll do my best to help you out :).

Cheers,

Mike
11647.txt (30 KB)

Works great, thank you very much. Just what I needed.

Hello all,

I would be very interested by the PieChart chartArea option too, those margins are so annoying.
But for now I don’t really know what to do with Mike’s patch. Is it possible to find an already patched JAR somewhere?

Thanks

Hey Mike,

I have patched according to your text file, but I was not sure which method(s) to use

to be able to control the margins.

I have tried the following methods:

setChartAreaLeft
setChartAreaTop
setChartAreaWidth
setChartAreaHeight

without any success.

Am I supposed to be using the setOptions method?

If you could please provide details on how to make use of this patch, I would really appreciate it.