echarts 3.5.4 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -18
- package/dist/echarts.common.js +10072 -9330
- package/dist/echarts.common.min.js +13 -13
- package/dist/echarts.js +13084 -11412
- package/dist/echarts.min.js +22 -21
- package/dist/echarts.simple.js +9454 -8889
- package/dist/echarts.simple.min.js +9 -10
- package/index.js +1 -0
- package/lib/chart/bar/BarView.js +141 -49
- package/lib/chart/bar/BaseBarSeries.js +2 -6
- package/lib/chart/bar.js +1 -0
- package/lib/chart/boxplot/BoxplotSeries.js +1 -1
- package/lib/chart/boxplot/boxplotLayout.js +23 -7
- package/lib/chart/candlestick/CandlestickSeries.js +1 -21
- package/lib/chart/candlestick/candlestickLayout.js +23 -7
- package/lib/chart/custom.js +442 -0
- package/lib/chart/graph/categoryVisual.js +3 -2
- package/lib/chart/heatmap/HeatmapView.js +75 -73
- package/lib/chart/helper/Symbol.js +8 -31
- package/lib/chart/helper/createListFromArray.js +15 -10
- package/lib/chart/helper/labelHelper.js +48 -0
- package/lib/chart/helper/whiskerBoxCommon.js +25 -44
- package/lib/chart/map/mapDataStatistic.js +9 -8
- package/lib/chart/pie/pieLayout.js +25 -17
- package/lib/chart/radar/RadarSeries.js +1 -1
- package/lib/chart/scatter/ScatterSeries.js +2 -3
- package/lib/chart/themeRiver/ThemeRiverSeries.js +6 -5
- package/lib/chart/themeRiver/themeRiverVisual.js +1 -1
- package/lib/chart/treemap/TreemapSeries.js +3 -3
- package/lib/component/axisPointer/BaseAxisPointer.js +7 -6
- package/lib/component/axisPointer/axisTrigger.js +62 -51
- package/lib/component/axisPointer.js +1 -2
- package/lib/component/calendar/CalendarView.js +5 -5
- package/lib/component/dataZoom/AxisProxy.js +76 -13
- package/lib/component/dataZoom/DataZoomModel.js +21 -5
- package/lib/component/dataZoom/InsideZoomModel.js +4 -1
- package/lib/component/dataZoom/InsideZoomView.js +16 -26
- package/lib/component/dataZoom/SliderZoomView.js +63 -26
- package/lib/component/dataZoom/roams.js +8 -3
- package/lib/component/graphic.js +13 -12
- package/lib/component/helper/BrushTargetManager.js +5 -5
- package/lib/component/helper/MapDraw.js +3 -3
- package/lib/component/helper/RoamController.js +43 -20
- package/lib/component/helper/brushHelper.js +2 -13
- package/lib/component/helper/selectableMixin.js +7 -7
- package/lib/component/helper/sliderMove.js +65 -36
- package/lib/component/legend/LegendView.js +6 -6
- package/lib/component/legend/legendAction.js +1 -1
- package/lib/component/marker/MarkAreaView.js +3 -6
- package/lib/component/marker/MarkLineView.js +3 -5
- package/lib/component/marker/MarkPointView.js +3 -5
- package/lib/component/marker/MarkerView.js +10 -12
- package/lib/component/polar.js +5 -0
- package/lib/component/timeline/SliderTimelineView.js +1 -1
- package/lib/component/toolbox/feature/DataZoom.js +14 -1
- package/lib/component/tooltip/TooltipView.js +3 -3
- package/lib/component/visualMap/ContinuousView.js +6 -4
- package/lib/coord/Axis.js +34 -2
- package/lib/coord/axisDefault.js +2 -1
- package/lib/coord/axisHelper.js +6 -25
- package/lib/coord/axisModelCommonMixin.js +1 -1
- package/lib/coord/calendar/Calendar.js +14 -17
- package/lib/coord/calendar/prepareCustom.js +31 -0
- package/lib/coord/cartesian/Axis2D.js +0 -12
- package/lib/coord/cartesian/Cartesian2D.js +1 -0
- package/lib/coord/cartesian/Grid.js +5 -2
- package/lib/coord/cartesian/prepareCustom.js +36 -0
- package/lib/coord/geo/Geo.js +9 -14
- package/lib/coord/geo/GeoModel.js +5 -5
- package/lib/coord/geo/geoCreator.js +3 -3
- package/lib/coord/geo/prepareCustom.js +36 -0
- package/lib/coord/parallel/Parallel.js +12 -11
- package/lib/coord/polar/Polar.js +2 -1
- package/lib/coord/polar/prepareCustom.js +53 -0
- package/lib/coord/single/Single.js +9 -8
- package/lib/coord/single/SingleAxis.js +0 -27
- package/lib/coord/single/prepareCustom.js +33 -0
- package/lib/data/DataDiffer.js +2 -1
- package/lib/data/Graph.js +11 -7
- package/lib/data/List.js +58 -19
- package/lib/data/helper/completeDimensions.js +184 -23
- package/lib/echarts.js +38 -33
- package/lib/helper.js +1 -8
- package/lib/layout/barGrid.js +87 -18
- package/lib/layout/barPolar.js +286 -0
- package/lib/layout/points.js +22 -16
- package/lib/model/Global.js +34 -31
- package/lib/model/Series.js +41 -29
- package/lib/model/mixin/colorPalette.js +2 -1
- package/lib/model/mixin/textStyle.js +7 -13
- package/lib/scale/Interval.js +21 -14
- package/lib/scale/Log.js +5 -7
- package/lib/scale/Time.js +13 -7
- package/lib/scale/helper.js +5 -1
- package/lib/util/format.js +12 -0
- package/lib/util/graphic.js +53 -1
- package/lib/util/model.js +63 -7
- package/map/js/world.js +1 -1
- package/map/json/world.json +1 -1
- package/package.json +3 -3
- package/src/chart/bar/BarView.js +141 -49
- package/src/chart/bar/BaseBarSeries.js +2 -6
- package/src/chart/bar.js +1 -0
- package/src/chart/boxplot/BoxplotSeries.js +1 -1
- package/src/chart/boxplot/boxplotLayout.js +23 -7
- package/src/chart/candlestick/CandlestickSeries.js +1 -21
- package/src/chart/candlestick/candlestickLayout.js +23 -7
- package/src/chart/custom.js +442 -0
- package/src/chart/graph/categoryVisual.js +3 -2
- package/src/chart/heatmap/HeatmapView.js +75 -73
- package/src/chart/helper/Symbol.js +8 -31
- package/src/chart/helper/createListFromArray.js +15 -10
- package/src/chart/helper/labelHelper.js +49 -0
- package/src/chart/helper/whiskerBoxCommon.js +25 -44
- package/src/chart/map/mapDataStatistic.js +9 -8
- package/src/chart/pie/pieLayout.js +25 -17
- package/src/chart/radar/RadarSeries.js +1 -1
- package/src/chart/scatter/ScatterSeries.js +2 -3
- package/src/chart/themeRiver/ThemeRiverSeries.js +6 -5
- package/src/chart/themeRiver/themeRiverVisual.js +1 -1
- package/src/chart/treemap/TreemapSeries.js +3 -3
- package/src/component/axisPointer/BaseAxisPointer.js +7 -6
- package/src/component/axisPointer/axisTrigger.js +62 -51
- package/src/component/axisPointer.js +1 -2
- package/src/component/calendar/CalendarView.js +5 -5
- package/src/component/dataZoom/AxisProxy.js +76 -13
- package/src/component/dataZoom/DataZoomModel.js +21 -5
- package/src/component/dataZoom/InsideZoomModel.js +4 -1
- package/src/component/dataZoom/InsideZoomView.js +16 -26
- package/src/component/dataZoom/SliderZoomView.js +63 -26
- package/src/component/dataZoom/roams.js +8 -3
- package/src/component/graphic.js +13 -12
- package/src/component/helper/BrushTargetManager.js +5 -5
- package/src/component/helper/MapDraw.js +3 -3
- package/src/component/helper/RoamController.js +43 -20
- package/src/component/helper/brushHelper.js +2 -13
- package/src/component/helper/selectableMixin.js +7 -7
- package/src/component/helper/sliderMove.js +65 -36
- package/src/component/legend/LegendView.js +6 -6
- package/src/component/legend/legendAction.js +1 -1
- package/src/component/marker/MarkAreaView.js +3 -6
- package/src/component/marker/MarkLineView.js +3 -5
- package/src/component/marker/MarkPointView.js +3 -5
- package/src/component/marker/MarkerView.js +10 -12
- package/src/component/polar.js +5 -0
- package/src/component/timeline/SliderTimelineView.js +1 -1
- package/src/component/toolbox/feature/DataZoom.js +14 -1
- package/src/component/tooltip/TooltipView.js +3 -3
- package/src/component/visualMap/ContinuousView.js +6 -4
- package/src/coord/Axis.js +34 -2
- package/src/coord/axisDefault.js +2 -1
- package/src/coord/axisHelper.js +6 -25
- package/src/coord/axisModelCommonMixin.js +1 -1
- package/src/coord/calendar/Calendar.js +14 -17
- package/src/coord/calendar/prepareCustom.js +32 -0
- package/src/coord/cartesian/Axis2D.js +0 -12
- package/src/coord/cartesian/Cartesian2D.js +1 -0
- package/src/coord/cartesian/Grid.js +5 -2
- package/src/coord/cartesian/prepareCustom.js +37 -0
- package/src/coord/geo/Geo.js +9 -14
- package/src/coord/geo/GeoModel.js +5 -5
- package/src/coord/geo/geoCreator.js +3 -3
- package/src/coord/geo/prepareCustom.js +37 -0
- package/src/coord/parallel/Parallel.js +12 -11
- package/src/coord/polar/Polar.js +2 -1
- package/src/coord/polar/prepareCustom.js +54 -0
- package/src/coord/single/Single.js +9 -8
- package/src/coord/single/SingleAxis.js +0 -27
- package/src/coord/single/prepareCustom.js +34 -0
- package/src/data/DataDiffer.js +2 -1
- package/src/data/Graph.js +11 -7
- package/src/data/List.js +58 -19
- package/src/data/helper/completeDimensions.js +184 -23
- package/src/echarts.js +38 -33
- package/src/helper.js +1 -8
- package/src/layout/barGrid.js +87 -18
- package/src/layout/barPolar.js +287 -0
- package/src/layout/points.js +22 -16
- package/src/model/Global.js +34 -31
- package/src/model/Series.js +41 -29
- package/src/model/mixin/colorPalette.js +2 -1
- package/src/model/mixin/textStyle.js +7 -13
- package/src/scale/Interval.js +21 -14
- package/src/scale/Log.js +5 -7
- package/src/scale/Time.js +13 -7
- package/src/scale/helper.js +5 -1
- package/src/util/format.js +12 -0
- package/src/util/graphic.js +53 -1
- package/src/util/model.js +63 -7
- package/src/coord/cartesian/axisLabelInterval.js +0 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "echarts",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "A powerful charting and visualization library for browser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visualization",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"prepublish": "node build/amd2common.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"zrender": "^3.
|
|
38
|
+
"zrender": "^3.5.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"coordtransform": "^2.0.2",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"fs-extra": "^0.26.5",
|
|
46
46
|
"glob": "^7.0.0",
|
|
47
47
|
"webpack": "^1.12.13",
|
|
48
|
-
"zrender": "^3.
|
|
48
|
+
"zrender": "^3.5.0"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/src/chart/bar/BarView.js
CHANGED
|
@@ -19,8 +19,13 @@ define(function (require) {
|
|
|
19
19
|
render: function (seriesModel, ecModel, api) {
|
|
20
20
|
var coordinateSystemType = seriesModel.get('coordinateSystem');
|
|
21
21
|
|
|
22
|
-
if (coordinateSystemType === 'cartesian2d'
|
|
23
|
-
|
|
22
|
+
if (coordinateSystemType === 'cartesian2d'
|
|
23
|
+
|| coordinateSystemType === 'polar'
|
|
24
|
+
) {
|
|
25
|
+
this._render(seriesModel, ecModel, api);
|
|
26
|
+
}
|
|
27
|
+
else if (__DEV__) {
|
|
28
|
+
console.warn('Only cartesian2d and polar supported for bar.');
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
return this.group;
|
|
@@ -28,14 +33,22 @@ define(function (require) {
|
|
|
28
33
|
|
|
29
34
|
dispose: zrUtil.noop,
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
_render: function (seriesModel, ecModel, api) {
|
|
32
37
|
var group = this.group;
|
|
33
38
|
var data = seriesModel.getData();
|
|
34
39
|
var oldData = this._data;
|
|
35
40
|
|
|
36
|
-
var
|
|
37
|
-
var baseAxis =
|
|
38
|
-
var
|
|
41
|
+
var coord = seriesModel.coordinateSystem;
|
|
42
|
+
var baseAxis = coord.getBaseAxis();
|
|
43
|
+
var isHorizontalOrRadial;
|
|
44
|
+
|
|
45
|
+
if (coord.type === 'cartesian2d') {
|
|
46
|
+
isHorizontalOrRadial = baseAxis.isHorizontal();
|
|
47
|
+
}
|
|
48
|
+
else if (coord.type === 'polar') {
|
|
49
|
+
isHorizontalOrRadial = baseAxis.dim === 'angle';
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;
|
|
40
53
|
|
|
41
54
|
data.diff(oldData)
|
|
@@ -45,12 +58,17 @@ define(function (require) {
|
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
var itemModel = data.getItemModel(dataIndex);
|
|
48
|
-
var layout =
|
|
49
|
-
var el =
|
|
61
|
+
var layout = getLayout[coord.type](data, dataIndex, itemModel);
|
|
62
|
+
var el = elementCreator[coord.type](
|
|
63
|
+
data, dataIndex, itemModel, layout, isHorizontalOrRadial, animationModel
|
|
64
|
+
);
|
|
50
65
|
data.setItemGraphicEl(dataIndex, el);
|
|
51
66
|
group.add(el);
|
|
52
67
|
|
|
53
|
-
updateStyle(
|
|
68
|
+
updateStyle(
|
|
69
|
+
el, data, dataIndex, itemModel, layout,
|
|
70
|
+
seriesModel, isHorizontalOrRadial, coord.type === 'polar'
|
|
71
|
+
);
|
|
54
72
|
})
|
|
55
73
|
.update(function (newIndex, oldIndex) {
|
|
56
74
|
var el = oldData.getItemGraphicEl(oldIndex);
|
|
@@ -61,24 +79,34 @@ define(function (require) {
|
|
|
61
79
|
}
|
|
62
80
|
|
|
63
81
|
var itemModel = data.getItemModel(newIndex);
|
|
64
|
-
var layout =
|
|
82
|
+
var layout = getLayout[coord.type](data, newIndex, itemModel);
|
|
65
83
|
|
|
66
84
|
if (el) {
|
|
67
85
|
graphic.updateProps(el, {shape: layout}, animationModel, newIndex);
|
|
68
86
|
}
|
|
69
87
|
else {
|
|
70
|
-
el =
|
|
88
|
+
el = elementCreator[coord.type](
|
|
89
|
+
data, newIndex, itemModel, layout, isHorizontalOrRadial, animationModel, true
|
|
90
|
+
);
|
|
71
91
|
}
|
|
72
92
|
|
|
73
93
|
data.setItemGraphicEl(newIndex, el);
|
|
74
94
|
// Add back
|
|
75
95
|
group.add(el);
|
|
76
96
|
|
|
77
|
-
updateStyle(
|
|
97
|
+
updateStyle(
|
|
98
|
+
el, data, newIndex, itemModel, layout,
|
|
99
|
+
seriesModel, isHorizontalOrRadial, coord.type === 'polar'
|
|
100
|
+
);
|
|
78
101
|
})
|
|
79
102
|
.remove(function (dataIndex) {
|
|
80
103
|
var el = oldData.getItemGraphicEl(dataIndex);
|
|
81
|
-
|
|
104
|
+
if (coord.type === 'cartesian2d') {
|
|
105
|
+
el && removeRect(dataIndex, animationModel, el);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
el && removeSector(dataIndex, animationModel, el);
|
|
109
|
+
}
|
|
82
110
|
})
|
|
83
111
|
.execute();
|
|
84
112
|
|
|
@@ -91,7 +119,12 @@ define(function (require) {
|
|
|
91
119
|
if (ecModel.get('animation')) {
|
|
92
120
|
if (data) {
|
|
93
121
|
data.eachItemGraphicEl(function (el) {
|
|
94
|
-
|
|
122
|
+
if (el.type === 'sector') {
|
|
123
|
+
removeSector(el.dataIndex, ecModel, el);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
removeRect(el.dataIndex, ecModel, el);
|
|
127
|
+
}
|
|
95
128
|
});
|
|
96
129
|
}
|
|
97
130
|
}
|
|
@@ -101,23 +134,50 @@ define(function (require) {
|
|
|
101
134
|
}
|
|
102
135
|
});
|
|
103
136
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
137
|
+
var elementCreator = {
|
|
138
|
+
|
|
139
|
+
cartesian2d: function (
|
|
140
|
+
data, dataIndex, itemModel, layout, isHorizontal,
|
|
141
|
+
animationModel, isUpdate
|
|
142
|
+
) {
|
|
143
|
+
var rect = new graphic.Rect({shape: zrUtil.extend({}, layout)});
|
|
144
|
+
|
|
145
|
+
// Animation
|
|
146
|
+
if (animationModel) {
|
|
147
|
+
var rectShape = rect.shape;
|
|
148
|
+
var animateProperty = isHorizontal ? 'height' : 'width';
|
|
149
|
+
var animateTarget = {};
|
|
150
|
+
rectShape[animateProperty] = 0;
|
|
151
|
+
animateTarget[animateProperty] = layout[animateProperty];
|
|
152
|
+
graphic[isUpdate ? 'updateProps' : 'initProps'](rect, {
|
|
153
|
+
shape: animateTarget
|
|
154
|
+
}, animationModel, dataIndex);
|
|
155
|
+
}
|
|
118
156
|
|
|
119
|
-
|
|
120
|
-
|
|
157
|
+
return rect;
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
polar: function (
|
|
161
|
+
data, dataIndex, itemModel, layout, isRadial,
|
|
162
|
+
animationModel, isUpdate
|
|
163
|
+
) {
|
|
164
|
+
var sector = new graphic.Sector({shape: zrUtil.extend({}, layout)});
|
|
165
|
+
|
|
166
|
+
// Animation
|
|
167
|
+
if (animationModel) {
|
|
168
|
+
var sectorShape = sector.shape;
|
|
169
|
+
var animateProperty = isRadial ? 'r' : 'endAngle';
|
|
170
|
+
var animateTarget = {};
|
|
171
|
+
sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;
|
|
172
|
+
animateTarget[animateProperty] = layout[animateProperty];
|
|
173
|
+
graphic[isUpdate ? 'updateProps' : 'initProps'](sector, {
|
|
174
|
+
shape: animateTarget
|
|
175
|
+
}, animationModel, dataIndex);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return sector;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
121
181
|
|
|
122
182
|
function removeRect(dataIndex, animationModel, el) {
|
|
123
183
|
// Not show text when animating
|
|
@@ -131,28 +191,58 @@ define(function (require) {
|
|
|
131
191
|
});
|
|
132
192
|
}
|
|
133
193
|
|
|
134
|
-
function
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
width: layout.width - signX * fixedLineWidth,
|
|
145
|
-
height: layout.height - signY * fixedLineWidth
|
|
146
|
-
};
|
|
194
|
+
function removeSector(dataIndex, animationModel, el) {
|
|
195
|
+
// Not show text when animating
|
|
196
|
+
el.style.text = '';
|
|
197
|
+
graphic.updateProps(el, {
|
|
198
|
+
shape: {
|
|
199
|
+
r: el.shape.r0
|
|
200
|
+
}
|
|
201
|
+
}, animationModel, dataIndex, function () {
|
|
202
|
+
el.parent && el.parent.remove(el);
|
|
203
|
+
});
|
|
147
204
|
}
|
|
148
205
|
|
|
149
|
-
|
|
206
|
+
var getLayout = {
|
|
207
|
+
cartesian2d: function (data, dataIndex, itemModel) {
|
|
208
|
+
var layout = data.getItemLayout(dataIndex);
|
|
209
|
+
var fixedLineWidth = getLineWidth(itemModel, layout);
|
|
210
|
+
|
|
211
|
+
// fix layout with lineWidth
|
|
212
|
+
var signX = layout.width > 0 ? 1 : -1;
|
|
213
|
+
var signY = layout.height > 0 ? 1 : -1;
|
|
214
|
+
return {
|
|
215
|
+
x: layout.x + signX * fixedLineWidth / 2,
|
|
216
|
+
y: layout.y + signY * fixedLineWidth / 2,
|
|
217
|
+
width: layout.width - signX * fixedLineWidth,
|
|
218
|
+
height: layout.height - signY * fixedLineWidth
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
polar: function (data, dataIndex, itemModel) {
|
|
223
|
+
var layout = data.getItemLayout(dataIndex);
|
|
224
|
+
return {
|
|
225
|
+
cx: layout.cx,
|
|
226
|
+
cy: layout.cy,
|
|
227
|
+
r0: layout.r0,
|
|
228
|
+
r: layout.r,
|
|
229
|
+
startAngle: layout.startAngle,
|
|
230
|
+
endAngle: layout.endAngle
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
function updateStyle(
|
|
236
|
+
el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar
|
|
237
|
+
) {
|
|
150
238
|
var color = data.getItemVisual(dataIndex, 'color');
|
|
151
239
|
var opacity = data.getItemVisual(dataIndex, 'opacity');
|
|
152
240
|
var itemStyleModel = itemModel.getModel('itemStyle.normal');
|
|
153
241
|
var hoverStyle = itemModel.getModel('itemStyle.emphasis').getBarItemStyle();
|
|
154
242
|
|
|
155
|
-
|
|
243
|
+
if (!isPolar && isHorizontal) {
|
|
244
|
+
el.setShape('r', itemStyleModel.get('barBorderRadius') || 0);
|
|
245
|
+
}
|
|
156
246
|
|
|
157
247
|
el.useStyle(zrUtil.defaults(
|
|
158
248
|
{
|
|
@@ -166,10 +256,12 @@ define(function (require) {
|
|
|
166
256
|
? (layout.height > 0 ? 'bottom' : 'top')
|
|
167
257
|
: (layout.width > 0 ? 'left' : 'right');
|
|
168
258
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
259
|
+
if (!isPolar) {
|
|
260
|
+
helper.setLabel(
|
|
261
|
+
el.style, hoverStyle, itemModel, color,
|
|
262
|
+
seriesModel, dataIndex, labelPositionOutside
|
|
263
|
+
);
|
|
264
|
+
}
|
|
173
265
|
|
|
174
266
|
graphic.setHoverStyle(el, hoverStyle);
|
|
175
267
|
}
|
|
@@ -10,12 +10,6 @@ define(function(require) {
|
|
|
10
10
|
type: 'series.__base_bar__',
|
|
11
11
|
|
|
12
12
|
getInitialData: function (option, ecModel) {
|
|
13
|
-
if (__DEV__) {
|
|
14
|
-
var coordSys = option.coordinateSystem;
|
|
15
|
-
if (coordSys !== 'cartesian2d') {
|
|
16
|
-
throw new Error('Bar only support cartesian2d coordinateSystem');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
13
|
return createListFromArray(option.data, this, ecModel);
|
|
20
14
|
},
|
|
21
15
|
|
|
@@ -47,6 +41,8 @@ define(function(require) {
|
|
|
47
41
|
|
|
48
42
|
// 最小高度改为0
|
|
49
43
|
barMinHeight: 0,
|
|
44
|
+
// 最小角度为0,仅对极坐标系下的柱状图有效
|
|
45
|
+
barMinAngle: 0,
|
|
50
46
|
|
|
51
47
|
// barMaxWidth: null,
|
|
52
48
|
// 默认自适应
|
package/src/chart/bar.js
CHANGED
|
@@ -11,6 +11,7 @@ define(function (require) {
|
|
|
11
11
|
var echarts = require('../echarts');
|
|
12
12
|
|
|
13
13
|
echarts.registerLayout(zrUtil.curry(barLayoutGrid, 'bar'));
|
|
14
|
+
|
|
14
15
|
// Visual coding for legend
|
|
15
16
|
echarts.registerVisual(function (ecModel) {
|
|
16
17
|
ecModel.eachSeriesByType('bar', function (seriesModel) {
|
|
@@ -109,17 +109,33 @@ define(function (require) {
|
|
|
109
109
|
function layoutSingleSeries(seriesModel, offset, boxWidth) {
|
|
110
110
|
var coordSys = seriesModel.coordinateSystem;
|
|
111
111
|
var data = seriesModel.getData();
|
|
112
|
-
var dimensions = seriesModel.dimensions;
|
|
113
|
-
var chartLayout = seriesModel.get('layout');
|
|
114
112
|
var halfWidth = boxWidth / 2;
|
|
113
|
+
var chartLayout = seriesModel.get('layout');
|
|
114
|
+
var variableDim = chartLayout === 'horizontal' ? 0 : 1;
|
|
115
|
+
var constDim = 1 - variableDim;
|
|
116
|
+
var coordDims = ['x', 'y'];
|
|
117
|
+
var vDims = [];
|
|
118
|
+
var cDim;
|
|
119
|
+
|
|
120
|
+
zrUtil.each(data.dimensions, function (dimName) {
|
|
121
|
+
var dimInfo = data.getDimensionInfo(dimName);
|
|
122
|
+
var coordDim = dimInfo.coordDim;
|
|
123
|
+
if (coordDim === coordDims[constDim]) {
|
|
124
|
+
vDims.push(dimName);
|
|
125
|
+
}
|
|
126
|
+
else if (coordDim === coordDims[variableDim]) {
|
|
127
|
+
cDim = dimName;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
if (cDim == null || vDims.length < 5) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
115
134
|
|
|
116
|
-
data.each(
|
|
135
|
+
data.each([cDim].concat(vDims), function () {
|
|
117
136
|
var args = arguments;
|
|
118
|
-
var dimLen = dimensions.length;
|
|
119
137
|
var axisDimVal = args[0];
|
|
120
|
-
var idx = args[
|
|
121
|
-
var variableDim = chartLayout === 'horizontal' ? 0 : 1;
|
|
122
|
-
var constDim = 1 - variableDim;
|
|
138
|
+
var idx = args[vDims.length + 1];
|
|
123
139
|
|
|
124
140
|
var median = getPoint(args[3]);
|
|
125
141
|
var end1 = getPoint(args[1]);
|
|
@@ -5,9 +5,6 @@ define(function(require) {
|
|
|
5
5
|
var zrUtil = require('zrender/core/util');
|
|
6
6
|
var SeriesModel = require('../../model/Series');
|
|
7
7
|
var whiskerBoxCommon = require('../helper/whiskerBoxCommon');
|
|
8
|
-
var formatUtil = require('../../util/format');
|
|
9
|
-
var encodeHTML = formatUtil.encodeHTML;
|
|
10
|
-
var addCommas = formatUtil.addCommas;
|
|
11
8
|
|
|
12
9
|
var CandlestickSeries = SeriesModel.extend({
|
|
13
10
|
|
|
@@ -18,7 +15,7 @@ define(function(require) {
|
|
|
18
15
|
/**
|
|
19
16
|
* @readOnly
|
|
20
17
|
*/
|
|
21
|
-
|
|
18
|
+
defaultValueDimensions: ['open', 'close', 'lowest', 'highest'],
|
|
22
19
|
|
|
23
20
|
/**
|
|
24
21
|
* @type {Array.<string>}
|
|
@@ -74,23 +71,6 @@ define(function(require) {
|
|
|
74
71
|
return 'open';
|
|
75
72
|
},
|
|
76
73
|
|
|
77
|
-
/**
|
|
78
|
-
* @override
|
|
79
|
-
*/
|
|
80
|
-
formatTooltip: function (dataIndex, mutipleSeries) {
|
|
81
|
-
// It rearly use mutiple candlestick series in one cartesian,
|
|
82
|
-
// so only consider one series in this default tooltip.
|
|
83
|
-
var valueHTML = zrUtil.map(this.valueDimensions, function (dim) {
|
|
84
|
-
return encodeHTML(dim + ': ' + addCommas(this.getData().get(dim, dataIndex)));
|
|
85
|
-
}, this).join('<br />');
|
|
86
|
-
|
|
87
|
-
var html = [];
|
|
88
|
-
this.name != null && html.push(encodeHTML(this.name));
|
|
89
|
-
valueHTML != null && html.push(valueHTML);
|
|
90
|
-
|
|
91
|
-
return html.join('<br />');
|
|
92
|
-
},
|
|
93
|
-
|
|
94
74
|
brushSelector: function (dataIndex, data, selectors) {
|
|
95
75
|
var itemLayout = data.getItemLayout(dataIndex);
|
|
96
76
|
return selectors.rect(itemLayout.brushRect);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
define(function (require) {
|
|
2
2
|
|
|
3
|
+
var zrUtil = require('zrender/core/util');
|
|
3
4
|
var retrieve = require('zrender/core/util').retrieve;
|
|
4
5
|
var parsePercent = require('../../util/number').parsePercent;
|
|
5
6
|
|
|
@@ -9,18 +10,33 @@ define(function (require) {
|
|
|
9
10
|
|
|
10
11
|
var coordSys = seriesModel.coordinateSystem;
|
|
11
12
|
var data = seriesModel.getData();
|
|
12
|
-
var
|
|
13
|
+
var candleWidth = calculateCandleWidth(seriesModel, data);
|
|
13
14
|
var chartLayout = seriesModel.get('layout');
|
|
15
|
+
var variableDim = chartLayout === 'horizontal' ? 0 : 1;
|
|
16
|
+
var constDim = 1 - variableDim;
|
|
17
|
+
var coordDims = ['x', 'y'];
|
|
18
|
+
var vDims = [];
|
|
19
|
+
var cDim;
|
|
20
|
+
|
|
21
|
+
zrUtil.each(data.dimensions, function (dimName) {
|
|
22
|
+
var dimInfo = data.getDimensionInfo(dimName);
|
|
23
|
+
var coordDim = dimInfo.coordDim;
|
|
24
|
+
if (coordDim === coordDims[constDim]) {
|
|
25
|
+
vDims.push(dimName);
|
|
26
|
+
}
|
|
27
|
+
else if (coordDim === coordDims[variableDim]) {
|
|
28
|
+
cDim = dimName;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
if (cDim == null || vDims.length < 4) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
16
35
|
|
|
17
|
-
data.each(
|
|
36
|
+
data.each([cDim].concat(vDims), function () {
|
|
18
37
|
var args = arguments;
|
|
19
|
-
var dimLen = dimensions.length;
|
|
20
38
|
var axisDimVal = args[0];
|
|
21
|
-
var idx = args[
|
|
22
|
-
var variableDim = chartLayout === 'horizontal' ? 0 : 1;
|
|
23
|
-
var constDim = 1 - variableDim;
|
|
39
|
+
var idx = args[vDims.length + 1];
|
|
24
40
|
|
|
25
41
|
var openVal = args[1];
|
|
26
42
|
var closeVal = args[2];
|