Reputation: 653
I am trying to set animation on a ColumnChart but there is no method in com.google.gwt.visualization.client.visualizations.corechart.Options to do so.
Apparently calling the following function does not work either: options.set("animation.duration", new Double(1000));
Has anyone managed to animate a corechart through GWT ?
Thanks for your help !
Hugues
==> Just found the answer myself. If anyone is interested the code is below. The idea is to extend the class com.google.gwt.visualization.client.visualizations.corechart.Options
import com.google.gwt.core.client.JavaScriptObject;
public class MyOptions extends com.google.gwt.visualization.client.visualizations.corechart.Options {
protected MyOptions() {
}
public final native void setAnimationDuration(double animationDuration) /*-{
this.animation={
duration: animationDuration,
easing: 'out',
}
}-*/;
public static MyOptions create() {
return JavaScriptObject.createObject().cast();
}
}
Upvotes: 0
Views: 535
Reputation: 171
That is incorrect form. You need to use smthing like this:
private Options createOptions()
{
Options option = Options.create();
Properties animation = Properties.create();
animation.set("duration", 1000.0);
animation.set("easing", "out");
option.set("animation", animation);
//return options;
return option;
}
it's answer for the future. You can see more details from acra-reporter Unfortunately at this moment it doesn't work on a piechart and I'm tring to solve this problem
Upvotes: 1