Skip to content

Commit 06047a9

Browse files
Chart: circle point symbol should be applied after changing customizePoint callback at runtime (T1284076) (DevExpress#29471)
1 parent 1452035 commit 06047a9

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

packages/devextreme/js/viz/series/points/base_point.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Point.prototype = {
295295
}
296296
that._setType(mixins[newPointTypeMixin]);
297297
} else {
298-
that._needDeletingOnDraw = that._checkSymbol(oldOptions, newOptions);
298+
that._needDeletingOnDraw = that._needDeletingOnDraw || that._checkSymbol(oldOptions, newOptions);
299299
that._needClearingOnDraw = that._checkCustomize(oldOptions, newOptions);
300300
}
301301

packages/devextreme/testing/tests/DevExpress.viz.core.series/symbolPoint.tests.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,36 @@ QUnit.test('Non-circle to circle', function(assert) {
17051705
assert.deepEqual(point.graphic.stub('append').lastCall.args[0], this.group);
17061706
});
17071707

1708+
QUnit.test('Point should be changed to a circle if updateOption() arises several times before redraw (T1284076)', function(assert) {
1709+
this.options.symbol = 'square';
1710+
const point = createPoint(this.series, { argument: 1, value: 1 }, this.options);
1711+
1712+
point.translate();
1713+
point.draw(this.renderer, this.groups);
1714+
1715+
const newOptions = $.extend(true, {}, this.options, { symbol: 'circle' });
1716+
point.updateOptions(newOptions);
1717+
point.updateOptions(newOptions);
1718+
point.translate();
1719+
point.draw(this.renderer, this.groups);
1720+
1721+
assert.ok(point.graphic);
1722+
assert.equal(point.graphic.typeOfNode, 'circle');
1723+
1724+
assert.equal(this.renderer.stub('path').callCount, 1);
1725+
assert.deepEqual(this.renderer.stub('path').firstCall.args[0], []);
1726+
assert.deepEqual(this.renderer.stub('path').firstCall.args[1], 'area');
1727+
1728+
assert.equal(this.renderer.stub('circle').callCount, 1);
1729+
assert.deepEqual(this.renderer.stub('circle').firstCall.args, []);
1730+
assert.equal(point.graphic.stub('attr').lastCall.args[0].translateX, 11);
1731+
assert.equal(point.graphic.stub('attr').lastCall.args[0].translateY, 22);
1732+
assert.equal(point.graphic.stub('attr').lastCall.args[0].r, 6);
1733+
assert.equal(point.graphic, this.renderer.stub('circle').firstCall.returnValue);
1734+
1735+
assert.deepEqual(point.graphic.stub('append').lastCall.args[0], this.group);
1736+
});
1737+
17081738
QUnit.test('Non-image to image (image option is string)', function(assert) {
17091739
this.options.symbol = 'circle';
17101740
const point = createPoint(this.series, { argument: 1, value: 1 }, this.options);

0 commit comments

Comments
 (0)