andydoroga1989 / gwt-google-apis

Automatically exported from code.google.com/p/gwt-google-apis
0 stars 0 forks source link

BarFormat.Options.setColorPositive issue #379

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
1.1.0

Detailed description:
The method
com.google.gwt.visualization.client.formatters.BarFormat.Options.setColorPositiv
e(Color
color) doesn't work as expected. Here's the corresponding JSNI method:

private native void setColorPositive(String color) /*-{
  this.colorNegative = color;
}-*/;

Workaround if you have one:

public static class CustomBarFormatOptions extends BarFormat.Options {
    protected CustomBarFormatOptions() {
    }
    public final void setColorPositiveCustom(Color color) {
        setColorPositive(color.toString());
    }
    private native void setColorPositive(String color) /*-{
        this.colorPositive = color;
    }-*/;
}

CustomBarFormatOptions barFormatOptions = (CustomBarFormatOptions)
BarFormat.Options.create();
barFormatOptions.setColorPositiveCustom(Color.GREEN);
BarFormat barFormat = BarFormat.create(barFormatOptions);

Links to the relevant GWT Developer Forum posts:

Original issue reported on code.google.com by alexande...@gmail.com on 29 May 2010 at 4:37

GoogleCodeExporter commented 9 years ago

Original comment by zundel@google.com on 19 Jun 2010 at 3:11

GoogleCodeExporter commented 9 years ago
Here's a patch for correcting this issue.

Original comment by rglafo...@gmail.com on 15 Mar 2012 at 6:30

Attachments: