jmchart 1.1.96 → 1.1.98
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/README.md +2 -0
- package/dist/jmchart.amd.js +108 -128
- package/dist/jmchart.cjs.js +108 -128
- package/dist/jmchart.esm.js +108 -128
- package/dist/jmchart.iife.js +108 -128
- package/dist/jmchart.system.js +108 -128
- package/example/line.html +1 -1
- package/example/radar.html +7 -5
- package/example/wk/line.html +12 -0
- package/package.json +2 -2
- package/src/component/vchart.js +1 -2
- package/src/core/axis/axis.js +2 -1
- package/src/core/legend/legend.js +2 -20
- package/src/core/markLine/markLine.js +1 -0
- package/src/jmChart.js +6 -0
- package/src/series/pieSeries.js +1 -13
- package/src/series/radarSeries.js +17 -36
- package/src/series/series.js +3 -1
- package/src/series/stackBarSeries.js +2 -1
|
@@ -108,8 +108,6 @@ export default class jmRadarSeries extends jmSeries {
|
|
|
108
108
|
// super.init会把参数透传给 createPoints
|
|
109
109
|
const { points, dataChanged } = this.initDataPoint(this.center, this.radius);
|
|
110
110
|
|
|
111
|
-
this.createLegend(points);
|
|
112
|
-
|
|
113
111
|
// 是否正在动画中
|
|
114
112
|
const isRunningAni = this.enableAnimate && (dataChanged || this.___animateCounter > 0 );
|
|
115
113
|
|
|
@@ -146,6 +144,7 @@ export default class jmRadarSeries extends jmSeries {
|
|
|
146
144
|
return self.option.onLeave.call(this, e);
|
|
147
145
|
});
|
|
148
146
|
}
|
|
147
|
+
this.createLegend(p);
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
shape.zIndex += p.radius / this.radius;// 用每个轴占比做为排序号,这样占面积最大的排最底层
|
|
@@ -216,6 +215,7 @@ export default class jmRadarSeries extends jmSeries {
|
|
|
216
215
|
|
|
217
216
|
const shapePoints = [];
|
|
218
217
|
for(const axis of this.axises) {
|
|
218
|
+
if(!axis || !axis.field) continue;
|
|
219
219
|
const yv = s[axis.field];
|
|
220
220
|
|
|
221
221
|
const p = {
|
|
@@ -293,40 +293,21 @@ export default class jmRadarSeries extends jmSeries {
|
|
|
293
293
|
*
|
|
294
294
|
* @method createLegend
|
|
295
295
|
*/
|
|
296
|
-
jmRadarSeries.prototype.createLegend = function(
|
|
297
|
-
if(!
|
|
296
|
+
jmRadarSeries.prototype.createLegend = function(point) {
|
|
297
|
+
if(!point) return;
|
|
298
298
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
//shape.targetShape = p.shape;
|
|
313
|
-
//此处重写图例事件
|
|
314
|
-
this.graph.legend.append(this, shape, {
|
|
315
|
-
name: this.legendLabel,
|
|
316
|
-
hover: function() {
|
|
317
|
-
//var sp = this.children.get(0);
|
|
318
|
-
//应用图的动态样式
|
|
319
|
-
Object.assign(this.targetShape.style, this.targetShape.style.hover);
|
|
320
|
-
Object.assign(this.style, this.style.hover);
|
|
321
|
-
},
|
|
322
|
-
leave: function() {
|
|
323
|
-
//var sp = this.children.get(0);
|
|
324
|
-
//应用图的普通样式
|
|
325
|
-
Object.assign(this.targetShape.style, this.targetShape.style.normal);
|
|
326
|
-
Object.assign(this.style, this.style.normal);
|
|
327
|
-
},
|
|
328
|
-
data: p.data
|
|
329
|
-
});
|
|
330
|
-
}
|
|
299
|
+
//生成图例前的图标
|
|
300
|
+
const style = this.graph.utils.clone(point.style);
|
|
301
|
+
|
|
302
|
+
//delete style.stroke;
|
|
303
|
+
const shape = this.graph.createShape('rect',{
|
|
304
|
+
style: style,
|
|
305
|
+
position : {x: 0, y: 0}
|
|
306
|
+
});
|
|
307
|
+
//此处重写图例事件
|
|
308
|
+
this.graph.legend.append(this, shape, {
|
|
309
|
+
name: this.legendLabel,
|
|
310
|
+
data: point.data
|
|
311
|
+
});
|
|
331
312
|
}
|
|
332
313
|
|
package/src/series/series.js
CHANGED
|
@@ -260,7 +260,9 @@ export default class jmSeries extends jmPath {
|
|
|
260
260
|
// 这里的点应相对于chartArea
|
|
261
261
|
p.x = xstep * i + this.xAxis.labelStart;
|
|
262
262
|
|
|
263
|
-
for(
|
|
263
|
+
for(let j=0; j<fields.length; j++) {
|
|
264
|
+
const f = fields[j];
|
|
265
|
+
|
|
264
266
|
const yv = s[f];
|
|
265
267
|
p.yLabel = p.yValue = yv;
|
|
266
268
|
// 高度
|
|
@@ -120,7 +120,8 @@ export default class jmStackBarSeries extends jmBarSeries {
|
|
|
120
120
|
|
|
121
121
|
for(const row of this.data) {
|
|
122
122
|
let max, min;
|
|
123
|
-
for(
|
|
123
|
+
for(let i=0; i<fields.length; i++) {
|
|
124
|
+
const f = fields[i];
|
|
124
125
|
const v = Number(row[f]);
|
|
125
126
|
if(typeof max === 'undefined') max = v;
|
|
126
127
|
else {
|