diff --git a/.travis.yml b/.travis.yml index 18e803c..d239585 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,12 +7,12 @@ cache: - $HOME/.m2 before_install: # install the gwt-material-jquery library -- git clone -b release_2.1.1 https://github.com/GwtMaterialDesign/gwt-material-jquery.git +- git clone -b release_2.2 https://github.com/GwtMaterialDesign/gwt-material-jquery.git - cd gwt-material-jquery - mvn install -DskipTests=true -DdryRun=true - cd .. # install the gwt-material library -- git clone -b release_2.1.1 https://github.com/GwtMaterialDesign/gwt-material.git +- git clone -b release_2.2 https://github.com/GwtMaterialDesign/gwt-material.git - cd gwt-material - mvn install -DskipTests=true -DdryRun=true - cd .. diff --git a/.utility/deploy.sh b/.utility/deploy.sh index f56a6e2..31d4a12 100644 --- a/.utility/deploy.sh +++ b/.utility/deploy.sh @@ -1,6 +1,6 @@ #!/bin/bash set -ev -if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.1.1" ]; then +if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.2" ]; then echo "ossrh\${env.OSSRH_USER}\${env.OSSRH_PASS}" > ~/settings.xml mvn deploy --settings ~/settings.xml fi \ No newline at end of file diff --git a/pom.xml b/pom.xml index 57d569a..ede16bd 100644 --- a/pom.xml +++ b/pom.xml @@ -6,14 +6,14 @@ com.github.gwtmaterialdesign gwt-material-parent - 2.1.1 + 2.2-SNAPSHOT 4.0.0 com.github.gwtmaterialdesign gwt-material-amcharts - 2.1.1 + 2.2-SNAPSHOT gwt-lib gwt-material-amcharts diff --git a/src/main/java/gwt/material/design/amcharts/client/ui/chart/base/AbstractChart.java b/src/main/java/gwt/material/design/amcharts/client/ui/chart/base/AbstractChart.java index 9fb3049..3b8bcbf 100644 --- a/src/main/java/gwt/material/design/amcharts/client/ui/chart/base/AbstractChart.java +++ b/src/main/java/gwt/material/design/amcharts/client/ui/chart/base/AbstractChart.java @@ -319,6 +319,10 @@ public void setDataProvider(Object dataProvider) { getChart().dataProvider = dataProvider; } + public Object getDataProvider(){ + return getChart().dataProvider; + } + /** * Decimal separator. */ diff --git a/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/AmCharts.java b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/AmCharts.java index f54fb21..e1b81b4 100644 --- a/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/AmCharts.java +++ b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/AmCharts.java @@ -149,6 +149,21 @@ public class AmCharts { */ public static native void makeChart(String elementId, Object value); - @JsMethod - public static native Object parseJSON(String value); + /** + * Loads a file from url and calls function handler with the result + */ + @JsMethod(namespace = "AmCharts") + public static native void loadFile(String dataSetUrl, Object options, Functions.Func1 data); + + /** + * Parses JSON string into an object + */ + @JsMethod(namespace = "AmCharts") + public static native Object parseJSON(Object value); + + /** + * Prases CSV string into an object + */ + @JsMethod(namespace = "AmCharts") + public static native Object parseCSV(Object value, Object options); } diff --git a/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmDataLoader.java b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmDataLoader.java index bf175d9..a1b6a69 100644 --- a/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmDataLoader.java +++ b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmDataLoader.java @@ -1,86 +1,89 @@ -/* - * #%L - * GwtMaterial - * %% - * Copyright (C) 2015 - 2018 GwtMaterialDesign - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ -package gwt.material.design.amcharts.client.ui.chart.js.options; - -import gwt.material.design.jquery.client.api.Functions; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - -//@formatter:off - -/** - * JSInterop util for {@link gwt.material.design.amcharts.client.ui.chart.options.DataLoader} - * - * @author kevzlou7979@gmail.com - * @see Official Documentation - */ -//@formatter:on -@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) -public class AmDataLoader { - - @JsProperty - public boolean async; - - @JsProperty - public Functions.Func complete; - - @JsProperty - public String delimiter; - - @JsProperty - public Functions.Func error; - - @JsProperty - public String format; - - @JsProperty - public Functions.Func load; - - @JsProperty - public boolean noStyles; - - @JsProperty - public Functions.Func postProcess; - - @JsProperty - public boolean showErrors; - - @JsProperty - public boolean showCurtain; - - @JsProperty - public int reload; - - @JsProperty - public String url; - - @JsProperty - public boolean reverse; - - @JsProperty - public int skip; - - @JsProperty - public boolean timestamp; - - @JsProperty - public boolean useColumnNames; -} +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2018 GwtMaterialDesign + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package gwt.material.design.amcharts.client.ui.chart.js.options; + +import gwt.material.design.jquery.client.api.Functions; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; + +//@formatter:off + +/** + * JSInterop util for {@link gwt.material.design.amcharts.client.ui.chart.options.DataLoader} + * + * @author kevzlou7979@gmail.com + * @see Official Documentation + */ +//@formatter:on +@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) +public class AmDataLoader { + + @JsProperty + public boolean async; + + @JsProperty + public Functions.Func complete; + + @JsProperty + public String delimiter; + + @JsProperty + public Functions.Func error; + + @JsProperty + public String format; + + @JsProperty + public Functions.Func load; + + @JsProperty + public boolean noStyles; + + @JsProperty + public Functions.Func postProcess; + + @JsProperty + public boolean showErrors; + + @JsProperty + public boolean showCurtain; + + @JsProperty + public int reload; + + @JsProperty + public String url; + + @JsProperty + public AmDataLoaderHeader[] headers; + + @JsProperty + public boolean reverse; + + @JsProperty + public int skip; + + @JsProperty + public boolean timestamp; + + @JsProperty + public boolean useColumnNames; +} diff --git a/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmDataLoaderHeader.java b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmDataLoaderHeader.java new file mode 100644 index 0000000..f40685a --- /dev/null +++ b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmDataLoaderHeader.java @@ -0,0 +1,35 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2018 GwtMaterialDesign + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package gwt.material.design.amcharts.client.ui.chart.js.options; + +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; + +@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) +public class AmDataLoaderHeader { + + @JsProperty + public String key; + + @JsProperty + public String value; + +} diff --git a/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmGaugeAxis.java b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmGaugeAxis.java index 4c037af..83d8113 100644 --- a/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmGaugeAxis.java +++ b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmGaugeAxis.java @@ -49,7 +49,7 @@ public class AmGaugeAxis extends AmAxisBase { public double bandAlpha; @JsProperty - public int[] bandGradientRatio; + public double[] bandGradientRatio; @JsProperty public double bandOutlineAlpha; diff --git a/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmGaugeBand.java b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmGaugeBand.java index 015f727..a3d3ec3 100644 --- a/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmGaugeBand.java +++ b/src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/AmGaugeBand.java @@ -49,7 +49,7 @@ public class AmGaugeBand { public int endValue; @JsProperty - public int[] gradientRatio; + public double[] gradientRatio; @JsProperty public String id; diff --git a/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/DataLoader.java b/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/DataLoader.java index 6fac1dc..1e77800 100644 --- a/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/DataLoader.java +++ b/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/DataLoader.java @@ -1,260 +1,286 @@ -/* - * #%L - * GwtMaterial - * %% - * Copyright (C) 2015 - 2018 GwtMaterialDesign - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ -package gwt.material.design.amcharts.client.ui.chart.options; - -import gwt.material.design.amcharts.client.ui.chart.base.ChartOptions; -import gwt.material.design.amcharts.client.ui.chart.js.options.AmDataLoader; -import gwt.material.design.jquery.client.api.Functions; - -//@formatter:off - -/** - * By default all amCharts libraries accept data in JSON format. It needs to be there when the web page loads, defined - * in-line or loaded via custom code. - *

- * This plugin introduces a native wrapper that enables automatic loading of data from external data data sources in - * CSV and JSON formats. - *

- * Most of the times you will just need to provide a URL of the external data source – static file or dynamically - * generated – and it will do the rest. - * - * @author kevzlou7979@gmail.com - * @see Official Documentation - */ -//@formatter:on -public class DataLoader extends ChartOptions { - - private AmDataLoader dataLoader; - - public boolean isAsync() { - return getAmDataLoader().async; - } - - /** - * If set to false (not recommended) everything will wait until data is fully loaded. Default to true - */ - - public void setAsync(boolean async) { - getAmDataLoader().async = async; - } - - - public Functions.Func getComplete() { - return getAmDataLoader().complete; - } - - /** - * Callback function to execute when loader is done. - */ - - public void setComplete(Functions.Func complete) { - getAmDataLoader().complete = complete; - } - - - public String getDelimiter() { - return getAmDataLoader().delimiter; - } - - /** - * [CSV only] a delimiter for columns (use t for tab delimiters). Default to comma(,). - */ - - public void setDelimiter(String delimiter) { - getAmDataLoader().delimiter = delimiter; - } - - - public Functions.Func getError() { - return getAmDataLoader().error; - } - - /** - * Callback function to execute if file load fails. - */ - - public void setError(Functions.Func error) { - getAmDataLoader().error = error; - } - - - public String getFormat() { - return getAmDataLoader().format; - } - - /** - * Type of data: json, csv. Default to Json - */ - - public void setFormat(String format) { - getAmDataLoader().format = format; - } - - - public Functions.Func getLoad() { - return getAmDataLoader().load; - } - - /** - * Callback function to execute when file is successfully loaded (might be invoked multiple times). - */ - - public void setLoad(Functions.Func load) { - getAmDataLoader().load = load; - } - - - public boolean isNoStyles() { - return getAmDataLoader().noStyles; - } - - /** - * If set to true no styles will be applied to “Data loading” curtain. Default to false - */ - - public void setNoStyles(boolean noStyles) { - getAmDataLoader().noStyles = noStyles; - } - - - public Functions.Func getPostProcess() { - return getAmDataLoader().postProcess; - } - - /** - * If set to function reference, that function will be called to “post-process” loaded data before passing it on - * to chart. - */ - - public void setPostProcess(Functions.Func postProcess) { - getAmDataLoader().postProcess = postProcess; - } - - - public boolean isShowErrors() { - return getAmDataLoader().showErrors; - } - - /** - * Show loading errors in a chart curtain. Default to true - */ - - public void setShowErrors(boolean showErrors) { - getAmDataLoader().showErrors = showErrors; - } - - - public boolean isShowCurtain() { - return getAmDataLoader().showCurtain; - } - - /** - * Show curtain over the chart area when loading data. Default to true - */ - - public void setShowCurtain(boolean showCurtain) { - getAmDataLoader().showCurtain = showCurtain; - } - - - public int getReload() { - return getAmDataLoader().reload; - } - - /** - * Reload data every X seconds. Default to 0 - */ - - public void setReload(int reload) { - getAmDataLoader().reload = reload; - } - - - public String getUrl() { - return getAmDataLoader().url; - } - - /** - * Url Resource of your data. - */ - - public void setUrl(String url) { - getAmDataLoader().url = url; - } - - - public boolean isReverse() { - return getAmDataLoader().reverse; - } - - /** - * [CSV only] add data points in revers order. Default to false - */ - - public void setReverse(boolean reverse) { - getAmDataLoader().reverse = reverse; - } - - - public int getSkip() { - return getAmDataLoader().skip; - } - - /** - * [CSV only] skip X first rows in data (includes first row if useColumnNames is used). Default to 0 - */ - - public void setSkip(int skip) { - getAmDataLoader().skip = skip; - } - - - public boolean isTimestamp() { - return getAmDataLoader().timestamp; - } - - /** - * Add current timestamp to data URLs (to avoid caching). Default false - */ - - public void setTimestamp(boolean timestamp) { - getAmDataLoader().timestamp = timestamp; - } - - - public boolean isUseColumnNames() { - return getAmDataLoader().useColumnNames; - } - - /** - * [CSV only] Use first row in data as column names when parsing. Default to false - */ - - public void setUseColumnNames(boolean useColumnNames) { - getAmDataLoader().useColumnNames = useColumnNames; - } - - public AmDataLoader getAmDataLoader() { - if (dataLoader == null) { - dataLoader = new AmDataLoader(); - } - return dataLoader; - } -} +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2018 GwtMaterialDesign + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package gwt.material.design.amcharts.client.ui.chart.options; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import gwt.material.design.amcharts.client.ui.chart.base.ChartOptions; +import gwt.material.design.amcharts.client.ui.chart.js.options.AmDataLoader; +import gwt.material.design.amcharts.client.ui.chart.js.options.AmDataLoaderHeader; +import gwt.material.design.jquery.client.api.Functions; + +//@formatter:off + +/** + * By default all amCharts libraries accept data in JSON format. It needs to be there when the web page loads, defined + * in-line or loaded via custom code. + *

+ * This plugin introduces a native wrapper that enables automatic loading of data from external data data sources in + * CSV and JSON formats. + *

+ * Most of the times you will just need to provide a URL of the external data source – static file or dynamically + * generated – and it will do the rest. + * + * @author kevzlou7979@gmail.com + * @see Official Documentation + */ +//@formatter:on +public class DataLoader extends ChartOptions { + + private AmDataLoader dataLoader; + + public boolean isAsync() { + return getAmDataLoader().async; + } + + /** + * If set to false (not recommended) everything will wait until data is fully loaded. Default to true + */ + + public void setAsync(boolean async) { + getAmDataLoader().async = async; + } + + + public Functions.Func getComplete() { + return getAmDataLoader().complete; + } + + /** + * Callback function to execute when loader is done. + */ + + public void setComplete(Functions.Func complete) { + getAmDataLoader().complete = complete; + } + + + public String getDelimiter() { + return getAmDataLoader().delimiter; + } + + /** + * [CSV only] a delimiter for columns (use t for tab delimiters). Default to comma(,). + */ + + public void setDelimiter(String delimiter) { + getAmDataLoader().delimiter = delimiter; + } + + + public Functions.Func getError() { + return getAmDataLoader().error; + } + + /** + * Callback function to execute if file load fails. + */ + + public void setError(Functions.Func error) { + getAmDataLoader().error = error; + } + + + public String getFormat() { + return getAmDataLoader().format; + } + + /** + * Type of data: json, csv. Default to Json + */ + + public void setFormat(String format) { + getAmDataLoader().format = format; + } + + + public Functions.Func getLoad() { + return getAmDataLoader().load; + } + + /** + * Callback function to execute when file is successfully loaded (might be invoked multiple times). + */ + + public void setLoad(Functions.Func load) { + getAmDataLoader().load = load; + } + + + public boolean isNoStyles() { + return getAmDataLoader().noStyles; + } + + /** + * If set to true no styles will be applied to “Data loading” curtain. Default to false + */ + + public void setNoStyles(boolean noStyles) { + getAmDataLoader().noStyles = noStyles; + } + + + public Functions.Func getPostProcess() { + return getAmDataLoader().postProcess; + } + + /** + * If set to function reference, that function will be called to “post-process” loaded data before passing it on + * to chart. + */ + + public void setPostProcess(Functions.Func postProcess) { + getAmDataLoader().postProcess = postProcess; + } + + + public boolean isShowErrors() { + return getAmDataLoader().showErrors; + } + + /** + * Show loading errors in a chart curtain. Default to true + */ + + public void setShowErrors(boolean showErrors) { + getAmDataLoader().showErrors = showErrors; + } + + + public boolean isShowCurtain() { + return getAmDataLoader().showCurtain; + } + + /** + * Show curtain over the chart area when loading data. Default to true + */ + + public void setShowCurtain(boolean showCurtain) { + getAmDataLoader().showCurtain = showCurtain; + } + + + public int getReload() { + return getAmDataLoader().reload; + } + + /** + * Reload data every X seconds. Default to 0 + */ + + public void setReload(int reload) { + getAmDataLoader().reload = reload; + } + + + public String getUrl() { + return getAmDataLoader().url; + } + + /** + * Url Resource of your data. + */ + + public void setUrl(String url) { + getAmDataLoader().url = url; + } + + + public boolean isReverse() { + return getAmDataLoader().reverse; + } + + /** + * [CSV only] add data points in revers order. Default to false + */ + + public void setReverse(boolean reverse) { + getAmDataLoader().reverse = reverse; + } + + + public int getSkip() { + return getAmDataLoader().skip; + } + + /** + * [CSV only] skip X first rows in data (includes first row if useColumnNames is used). Default to 0 + */ + + public void setSkip(int skip) { + getAmDataLoader().skip = skip; + } + + + public boolean isTimestamp() { + return getAmDataLoader().timestamp; + } + + /** + * Add current timestamp to data URLs (to avoid caching). Default false + */ + + public void setTimestamp(boolean timestamp) { + getAmDataLoader().timestamp = timestamp; + } + + + public boolean isUseColumnNames() { + return getAmDataLoader().useColumnNames; + } + + /** + * [CSV only] Use first row in data as column names when parsing. Default to false + */ + + public void setUseColumnNames(boolean useColumnNames) { + getAmDataLoader().useColumnNames = useColumnNames; + } + + public AmDataLoader getAmDataLoader() { + if (dataLoader == null) { + dataLoader = new AmDataLoader(); + } + return dataLoader; + } + + /** + * Add an HTTP Header to the DataLoader + * @param key Header key + * @param value Header value + */ + public void addHeader(String key, String value){ + List headers; + if(this.getAmDataLoader().headers!=null){ + headers=new ArrayList(Arrays.asList(this.getAmDataLoader().headers)); + }else{ + headers=new ArrayList(); + } + AmDataLoaderHeader header=new AmDataLoaderHeader(); + header.key=key; + header.value=value; + headers.add(header); + AmDataLoaderHeader[] array=new AmDataLoaderHeader[headers.size()]; + this.getAmDataLoader().headers=headers.toArray(array); + } + +} diff --git a/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/GaugeAxis.java b/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/GaugeAxis.java index 656a4a8..c5eb3d7 100644 --- a/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/GaugeAxis.java +++ b/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/GaugeAxis.java @@ -113,7 +113,7 @@ public void setBandAlpha(double bandAlpha) { } - public int[] getBandGradientRatio() { + public double[] getBandGradientRatio() { return getAmGaugeAxis().bandGradientRatio; } @@ -121,7 +121,7 @@ public int[] getBandGradientRatio() { * Example: [-0.2, 0, -0.2]. Will make bands to be filled with color gradients. Negative value means the color will * be darker than the original, and positive number means the color will be lighter. */ - public void setBandGradientRatio(int[] bandGradientRatio) { + public void setBandGradientRatio(double[] bandGradientRatio) { getAmGaugeAxis().bandGradientRatio = bandGradientRatio; } diff --git a/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/GaugeBand.java b/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/GaugeBand.java index 6bfa8bc..674e091 100644 --- a/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/GaugeBand.java +++ b/src/main/java/gwt/material/design/amcharts/client/ui/chart/options/GaugeBand.java @@ -85,7 +85,7 @@ public void setEndValue(int value) { getAmGaugeBand().setEndValue(value); } - public int[] getGradientRatio() { + public double[] getGradientRatio() { return getAmGaugeBand().gradientRatio; } @@ -93,7 +93,7 @@ public int[] getGradientRatio() { * Example: [-0.2, 0, -0.2]. Will make bands to be filled with color gradients. Negative value means the color will * be darker than the original, and positive number means the color will be lighter. */ - public void setGradientRatio(int[] gradientRatio) { + public void setGradientRatio(double[] gradientRatio) { getAmGaugeBand().gradientRatio = gradientRatio; }