Hi,
first post here and fairly new to gwt and gwt-ext so please don't beat me up if this sounds too basic...
I've been experimenting with gwt-ext charts for the past couple of weeks and I've been trying to set the animationEnabled style parameter for a YUI ColumnChart (through gwt-ext) without any luck.
Looking at the documentation for basic styling
here it looks like standard CSS but it's NOT ! ! !
From the link above:
Quote:
Because the Charts Control is powered by Flash Player, standard browser CSS is not available for styling individual subcomponents of a chart. Instead, styleable properties are exposed through a style attribute on the chart itself. This hash accepts a standardized set of style values for things like border, background, fonts, padding, axis styles, and datatip styles.
To cut a long story short this means that we need access to the chartConfig member declared in com.gwtext.client.widgets.chart.yui.ChartPanel so I've added an accessor method for that member.
I've also added a "convenience" method for the particular property I want to disable (animationEnabled) but that's not very clean. I suspect that the proper way to do is to create a new ChartStyle class that contains all the properties defined in the above link and is accessible through a set of ChartStyle getter/setter methods (similar to the Axis class handling the xAxis and yAxis parameters).
I might actually get to do this myself depending on how the project (based on gwt-ext) the company I work for is going to progress so that other members of the community can have access to it...
What I would like to know for now is if what I'm saying makes sense or if there's another way to modify the style properties or even access the chartConfig object.
Finally this seems to be a very similar request to what's been asked in the topic below, so I'm bumping it as well.
How to insert a legend in a chart ?Cheers,
Vas.
P.S.: for those who're interested here's how I've modified ChartPanel
Code:
public JavaScriptObject getChartConfig(){
return chartConfig;
}
public void setAnimationEnabled(boolean animationEnabled){
JavaScriptObject styleObject = JavaScriptObjectHelper.getAttributeAsJavaScriptObject(chartConfig, "style");
if (styleObject == null) {
styleObject = JavaScriptObjectHelper.createObject();
}
JavaScriptObjectHelper.setAttribute(styleObject, "animationEnabled", animationEnabled);
JavaScriptObjectHelper.setAttribute(chartConfig, "style", styleObject);
}