Skip to content

Commit 605a955

Browse files
authored
BarGauge: throw W2104 if there is no place for render legend (T1307508) (#31116)
1 parent a902040 commit 605a955

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/devextreme/js/viz/gauges/bar_gauge.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,9 @@ export const dxBarGauge = BaseGauge.inherit({
435435
const that = this;
436436
const options = that._options.silent();
437437

438+
const legendOptions = that._themeManager.theme('legend');
439+
legendOptions._incidentOccurred = that._incidentOccurred;
440+
438441
that._palette = that._themeManager.createPalette(options.palette, {
439442
useHighlight: true,
440443
extensionMode: options.paletteExtensionMode

packages/devextreme/testing/tests/DevExpress.viz.gauges/barGauge_new.tests.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ QUnit.test('Legend update should call trigger core content rerender', function(a
339339
assert.strictEqual(gauge.renderCount, initialRenderCount + 1);
340340
});
341341

342+
QUnit.test('gauge legend should have the same reference to _incidentOccurred as gauge itself (T1307508)', function(assert) {
343+
const gauge = this.createGauge({});
344+
345+
const gaugeIncidentOccurred = gauge._incidentOccurred;
346+
const legendIncidentOccurred = gauge._themeManager.theme('legend')._incidentOccurred;
347+
348+
assert.strictEqual(gaugeIncidentOccurred, legendIncidentOccurred, 'functions are the same');
349+
});
350+
342351
QUnit.module('Center Template', environment);
343352

344353
QUnit.test('Should create group for center template on widget creating', function(assert) {

0 commit comments

Comments
 (0)