Skip to content

Commit fc40eeb

Browse files
committed
Updates / Fixes on AmChart core libraries.
- Fixed params, and removed unused classes. - Fixed compilation issue.
1 parent 86bbb3d commit fc40eeb

31 files changed

+1122
-1127
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
import gwt.material.design.amcharts.client.ui.chart.events.object.CoordinateGraphItemData;
3131
import gwt.material.design.amcharts.client.ui.chart.js.AmCoordinateChart;
3232
import gwt.material.design.amcharts.client.ui.chart.js.AmGraph;
33+
import gwt.material.design.amcharts.client.ui.chart.js.options.Guide;
3334
import gwt.material.design.amcharts.client.ui.chart.js.options.AmValueAxis;
3435
import gwt.material.design.amcharts.client.ui.chart.options.Graph;
35-
import gwt.material.design.amcharts.client.ui.chart.options.Guide;
3636
import gwt.material.design.amcharts.client.ui.chart.options.ValueAxis;
3737
import gwt.material.design.client.base.helper.ColorHelper;
3838
import gwt.material.design.client.constants.Color;
@@ -133,9 +133,7 @@ public void setGridAboveGraphs(boolean gridAboveGraphs) {
133133
* specify a different valueAxis for the guide.
134134
*/
135135
public void setGuides(Guide... guides) {
136-
for (int i = 0; i < guides.length; i++) {
137-
getChart().guides[i] = guides[i].getAmGuide();
138-
}
136+
getChart().guides = guides;
139137
}
140138

141139
/**

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

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
import gwt.material.design.amcharts.client.ui.chart.base.constants.ChartType;
2323
import gwt.material.design.amcharts.client.ui.chart.js.AmGanttChart;
24-
import gwt.material.design.amcharts.client.ui.chart.js.AmGraph;
25-
import gwt.material.design.amcharts.client.ui.chart.js.options.AmValueAxis;
24+
import gwt.material.design.amcharts.client.ui.chart.options.Graph;
25+
import gwt.material.design.amcharts.client.ui.chart.options.ValueAxis;
2626

2727
//@formatter:off
2828

@@ -36,6 +36,7 @@
3636
//@formatter:on
3737
public class GanttChart extends SerialChart {
3838

39+
private AmGanttChart amGanttChart;
3940

4041
public GanttChart() {
4142
super(ChartType.GANTT);
@@ -83,8 +84,8 @@ public void setEndField(String endField) {
8384
* Graph of a Gantt chart. Gant chart actually creates multiple graphs (separate for each segment). Properties of
8485
* this graph are passed to each of the created graphs - this allows you to control the look of segments.
8586
*/
86-
public void setGraph(AmGraph graph) {
87-
getChart().graph = graph;
87+
public void setGraph(Graph graph) {
88+
getChart().graph = graph.getAmGraph();
8889
}
8990

9091
/**
@@ -94,6 +95,10 @@ public void setPeriod(String period) {
9495
getChart().period = period;
9596
}
9697

98+
public void setColorField(String colorField) {
99+
getChart().colorField = colorField;
100+
}
101+
97102
/**
98103
* Segments field in your data provider.
99104
*/
@@ -121,12 +126,16 @@ public void setStartField(String startField) {
121126
/**
122127
* Value axis of Gantt chart. Set it's type to "date" if your data is date or time based.
123128
*/
124-
public void setValueAxis(AmValueAxis valueAxis) {
125-
getChart().valueAxis = valueAxis;
129+
public void setValueAxis(ValueAxis valueAxis) {
130+
getChart().valueAxis = valueAxis.getAmValueAxis();
131+
valueAxis.load();
126132
}
127133

128134
@Override
129135
public AmGanttChart getChart() {
130-
return new AmGanttChart();
136+
if (amGanttChart == null) {
137+
amGanttChart = new AmGanttChart();
138+
}
139+
return amGanttChart;
131140
}
132141
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import gwt.material.design.amcharts.client.ui.chart.base.constants.ChartType;
2323
import gwt.material.design.amcharts.client.ui.chart.js.AmPieChart;
24+
import gwt.material.design.amcharts.client.ui.chart.js.options.GraphDataItem;
2425
import gwt.material.design.jquery.client.api.Functions;
2526

2627
//@formatter:off
@@ -57,7 +58,7 @@ public void setAngle(int angle) {
5758

5859
/**
5960
* If you set some function, the graph will call it and pass
60-
* {@link gwt.material.design.amcharts.client.ui.chart.options.GraphDataItem} object to it. This function
61+
* {@link GraphDataItem} object to it. This function
6162
* should return a string which will be displayed in a balloon.
6263
*/
6364
public void setBalloonFunction(Functions.Func balloonFunction) {

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -86,38 +86,6 @@ public void setDepth3D(int depth3D) {
8686
getChart().depth3D = depth3D;
8787
}
8888

89-
/**
90-
* Number of pixels between the container's bottom border and plot area. This space can be used for bottom axis'
91-
* values. If autoMargin is true and bottom side has axis, this property is ignored. Default to 20
92-
*/
93-
public void setMarginLeft(int marginLeft) {
94-
getChart().marginLeft = marginLeft;
95-
}
96-
97-
/**
98-
* Number of pixels between the container's bottom border and plot area. This space can be used for left axis' values.
99-
* If autoMargin is true and left side has axis, this property is ignored. Default to 20
100-
*/
101-
public void setMarginBottom(int marginBottom) {
102-
getChart().marginBottom = marginBottom;
103-
}
104-
105-
/**
106-
* Number of pixels between the container's right border and plot area. This space can be used for Right axis'
107-
* values. If autoMargin is true and right side has axis, this property is ignored. Default to 20
108-
*/
109-
public void setMarginRight(int marginRight) {
110-
getChart().marginRight = marginRight;
111-
}
112-
113-
/**
114-
* Number of pixels between the container's top border and plot area. This space can be used for top axis' values.
115-
* If autoMargin is true and top side has axis, this property is ignored. Default to 20
116-
*/
117-
public void setMarginTop(int marginTop) {
118-
getChart().marginTop = marginTop;
119-
}
120-
12189
/**
12290
* Flag which should be set to false if you need margins to be recalculated on next chart.validateNow() call.
12391
* Default to false

src/main/java/gwt/material/design/amcharts/client/ui/chart/events/object/AxisGuideData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
package gwt.material.design.amcharts.client.ui.chart.events.object;
2121

2222
import gwt.material.design.amcharts.client.ui.chart.js.AmRectangularChart;
23-
import gwt.material.design.amcharts.client.ui.chart.js.options.AmGuide;
23+
import gwt.material.design.amcharts.client.ui.chart.js.options.Guide;
2424
import jsinterop.annotations.JsOverlay;
2525
import jsinterop.annotations.JsPackage;
2626
import jsinterop.annotations.JsProperty;
@@ -33,7 +33,7 @@ public class AxisGuideData {
3333
private String type;
3434

3535
@JsProperty
36-
private AmGuide graph;
36+
private Guide graph;
3737

3838
@JsProperty
3939
private AmRectangularChart chart;
@@ -44,7 +44,7 @@ public final String getType() {
4444
}
4545

4646
@JsOverlay
47-
public final AmGuide getGraph() {
47+
public final Guide getGraph() {
4848
return graph;
4949
}
5050

src/main/java/gwt/material/design/amcharts/client/ui/chart/events/object/AxisItemData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import gwt.material.design.amcharts.client.ui.chart.js.AmRectangularChart;
2323
import gwt.material.design.amcharts.client.ui.chart.js.options.AmAxisBase;
24-
import gwt.material.design.amcharts.client.ui.chart.js.options.AmSerialDataItem;
24+
import gwt.material.design.amcharts.client.ui.chart.js.options.SerialDataItem;
2525
import gwt.material.design.amcharts.client.ui.chart.js.options.Label;
2626
import gwt.material.design.jquery.client.api.MouseEvent;
2727
import jsinterop.annotations.JsOverlay;
@@ -51,7 +51,7 @@ public class AxisItemData {
5151
private Object value;
5252

5353
@JsProperty
54-
private AmSerialDataItem serialDataItem;
54+
private SerialDataItem serialDataItem;
5555

5656
@JsOverlay
5757
public final String getType() {
@@ -64,7 +64,7 @@ public final Object getValue() {
6464
}
6565

6666
@JsOverlay
67-
public final AmSerialDataItem getSerialDataItem() {
67+
public final SerialDataItem getSerialDataItem() {
6868
return serialDataItem;
6969
}
7070

src/main/java/gwt/material/design/amcharts/client/ui/chart/events/object/CoordinateGraphItemData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import gwt.material.design.amcharts.client.ui.chart.js.AmChart;
2323
import gwt.material.design.amcharts.client.ui.chart.js.AmGraph;
24-
import gwt.material.design.amcharts.client.ui.chart.js.options.AmGraphDataItem;
24+
import gwt.material.design.amcharts.client.ui.chart.js.options.GraphDataItem;
2525
import gwt.material.design.jquery.client.api.MouseEvent;
2626
import jsinterop.annotations.JsOverlay;
2727
import jsinterop.annotations.JsPackage;
@@ -35,7 +35,7 @@ public class CoordinateGraphItemData {
3535
private AmGraph graph;
3636

3737
@JsProperty
38-
private AmGraphDataItem item;
38+
private GraphDataItem item;
3939

4040
@JsProperty
4141
private int index;
@@ -52,7 +52,7 @@ public final AmGraph getGraph() {
5252
}
5353

5454
@JsOverlay
55-
public final AmGraphDataItem getItem() {
55+
public final GraphDataItem getItem() {
5656
return item;
5757
}
5858

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
package gwt.material.design.amcharts.client.ui.chart.js;
2121

22-
import gwt.material.design.amcharts.client.ui.chart.js.options.AmGuide;
22+
import gwt.material.design.amcharts.client.ui.chart.js.options.Guide;
2323
import gwt.material.design.amcharts.client.ui.chart.js.options.AmValueAxis;
2424
import jsinterop.annotations.JsMethod;
2525
import jsinterop.annotations.JsProperty;
@@ -69,7 +69,7 @@ public class AmCoordinateChart extends AmChart {
6969
* specify a different valueAxis for the guide.
7070
*/
7171
@JsProperty
72-
public AmGuide[] guides;
72+
public Guide[] guides;
7373

7474
/**
7575
* Specifies whether the animation should be sequenced or all objects should appear at once. Default to true

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ public class AmGanttChart extends AmSerialChart {
9090
@JsProperty
9191
public String segmentsField;
9292

93+
/**
94+
* Color field in your data provider
95+
*/
96+
@JsProperty
97+
public String colorField;
98+
9399
/**
94100
* Initial date of value axis. If you set this date (you can do it using time stamp, Date object or date string),
95101
* you can then set start/end/duration of segments using number of periods instead of providing exact dates.

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020
package gwt.material.design.amcharts.client.ui.chart.js;
2121

22+
import gwt.material.design.amcharts.client.ui.chart.js.options.GraphDataItem;
2223
import gwt.material.design.amcharts.client.ui.chart.js.options.AmValueAxis;
2324
import gwt.material.design.jquery.client.api.Functions;
2425
import jsinterop.annotations.JsMethod;
@@ -53,7 +54,7 @@ public class AmGraph {
5354
public String balloonColor;
5455

5556
@JsProperty
56-
public Functions.Func balloonFunction;
57+
public Functions.FuncRet1<GraphDataItem> balloonFunction;
5758

5859
@JsProperty
5960
public String balloonText;
@@ -65,19 +66,19 @@ public class AmGraph {
6566
public String bullet;
6667

6768
@JsProperty
68-
public int bulletAlpha;
69+
public double bulletAlpha;
6970

7071
@JsProperty
7172
public AmValueAxis bulletAxis;
7273

7374
@JsProperty
74-
public int bulletBorderAlpha;
75+
public double bulletBorderAlpha;
7576

7677
@JsProperty
7778
public String bulletBorderColor;
7879

7980
@JsProperty
80-
public String bulletBorderThickness;
81+
public int bulletBorderThickness;
8182

8283
@JsProperty
8384
public String bulletColor;
@@ -104,7 +105,7 @@ public class AmGraph {
104105
public String closeField;
105106

106107
@JsProperty
107-
public String clustered;
108+
public boolean clustered;
108109

109110
@JsProperty
110111
public String color;
@@ -116,7 +117,7 @@ public class AmGraph {
116117
public String columnIndexField;
117118

118119
@JsProperty
119-
public String columnWidth;
120+
public double columnWidth;
120121

121122
@JsProperty
122123
public boolean connect;
@@ -125,7 +126,7 @@ public class AmGraph {
125126
public int cornerRadiusTop;
126127

127128
@JsProperty
128-
public int cursorBulletAlpha;
129+
public double cursorBulletAlpha;
129130

130131
@JsProperty
131132
public String customBullet;
@@ -152,7 +153,7 @@ public class AmGraph {
152153
public String errorField;
153154

154155
@JsProperty
155-
public int fillAlphas;
156+
public double fillAlphas;
156157

157158
@JsProperty
158159
public String fillColors;
@@ -206,7 +207,7 @@ public class AmGraph {
206207
public String labelColorField;
207208

208209
@JsProperty
209-
public Functions.Func labelFunction;
210+
public Functions.FuncRet1<Object> labelFunction;
210211

211212
@JsProperty
212213
public int labelOffset;

0 commit comments

Comments
 (0)