Skip to content

Commit 3b32442

Browse files
committed
Fixed - Margin configurations must be overridden instead of it's MaterialWidget base configs.
Added validateNow() method for optional params.
1 parent fc40eeb commit 3b32442

File tree

8 files changed

+137
-4
lines changed

8 files changed

+137
-4
lines changed

src/main/java/gwt/material/design/amcharts/client/ui/chart/RectangularChart.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import gwt.material.design.amcharts.client.ui.chart.options.TrendLine;
2727
import gwt.material.design.client.base.helper.ColorHelper;
2828
import gwt.material.design.client.constants.Color;
29+
import gwt.material.design.client.ui.MaterialToast;
2930

3031
//@formatter:off
3132

@@ -94,6 +95,31 @@ public void setMarginsUpdated(boolean marginsUpdated) {
9495
getChart().marginsUpdated = marginsUpdated;
9596
}
9697

98+
@Override
99+
public void setMargin(double margin) {
100+
super.setMargin(margin);
101+
}
102+
103+
@Override
104+
public void setMarginTop(double marginTop) {
105+
getChart().marginTop = (int) marginTop;
106+
}
107+
108+
@Override
109+
public void setMarginBottom(double marginBottom) {
110+
getChart().marginBottom = (int) marginBottom;
111+
}
112+
113+
@Override
114+
public void setMarginLeft(double marginLeft) {
115+
getChart().marginLeft = (int) marginLeft;
116+
}
117+
118+
@Override
119+
public void setMarginRight(double marginRight) {
120+
getChart().marginRight = (int) marginRight;
121+
}
122+
97123
/**
98124
* Maximum zoom factor value axes. Default to 20
99125
*/

src/main/java/gwt/material/design/amcharts/client/ui/chart/base/AbstractChart.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,14 @@ public void validateNow(Object validateData, boolean skipEvents) {
695695
getChart().validateNow(validateData, skipEvents);
696696
}
697697

698+
/**
699+
* This method should be called after you changed one or more properties of any class. The chart will redraw after
700+
* this method is called.Both attributes, validateData and skipEvents are optional (false by default).
701+
*/
702+
public void validateNow() {
703+
getChart().validateNow();
704+
}
705+
698706
/**
699707
* Adds chart to the specified DIV.
700708
*

src/main/java/gwt/material/design/amcharts/client/ui/chart/js/AmChart.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
import gwt.material.design.amcharts.client.ui.chart.js.options.Title;
2626
import gwt.material.design.amcharts.client.ui.chart.plugins.export.js.AmExportOption;
2727
import gwt.material.design.jquery.client.api.Functions;
28-
import jsinterop.annotations.JsMethod;
29-
import jsinterop.annotations.JsPackage;
30-
import jsinterop.annotations.JsProperty;
31-
import jsinterop.annotations.JsType;
28+
import jsinterop.annotations.*;
3229

3330
//@formatter:off
3431

@@ -533,6 +530,13 @@ public class AmChart {
533530
@JsMethod
534531
public native void validateNow(Object validateData, boolean skipEvents);
535532

533+
/**
534+
* This method should be called after you changed one or more properties of any class. The chart will redraw after
535+
* this method is called.Both attributes, validateData and skipEvents are optional (false by default).
536+
*/
537+
@JsMethod
538+
public native void validateNow();
539+
536540
/**
537541
* Adds chart to the specified DIV.
538542
*

src/main/java/gwt/material/design/amcharts/client/ui/chart/js/options/Values.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2018 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
120
package gwt.material.design.amcharts.client.ui.chart.js.options;
221

322
import jsinterop.annotations.JsOverlay;

src/main/java/gwt/material/design/amcharts/client/ui/stock/StockGraph.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2018 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
120
package gwt.material.design.amcharts.client.ui.stock;
221

322
import gwt.material.design.amcharts.client.ui.chart.base.constants.GraphType;

src/main/java/gwt/material/design/amcharts/client/ui/stock/StockLegend.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2018 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
120
package gwt.material.design.amcharts.client.ui.stock;
221

322
import gwt.material.design.amcharts.client.ui.chart.options.Legend;

src/main/java/gwt/material/design/amcharts/client/ui/stock/StockPanel.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2018 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
120
package gwt.material.design.amcharts.client.ui.stock;
221

322
import gwt.material.design.amcharts.client.ui.chart.SerialChart;

src/main/java/gwt/material/design/amcharts/client/ui/stock/js/Period.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2018 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
120
package gwt.material.design.amcharts.client.ui.stock.js;
221

322
import jsinterop.annotations.JsOverlay;

0 commit comments

Comments
 (0)