From f723cb7c010d3f0002bed01930ec4d28ac8b9a19 Mon Sep 17 00:00:00 2001 From: viterobk Date: Fri, 2 Mar 2018 17:49:42 +0300 Subject: [PATCH] Release 17.1.10 --- js/viz/gauges/linear_gauge.js | 9 ++++++--- .../DevExpress.viz.gauges/linearGauge.tests.js | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/js/viz/gauges/linear_gauge.js b/js/viz/gauges/linear_gauge.js index 06ed61fe8829..d43b955f5edd 100644 --- a/js/viz/gauges/linear_gauge.js +++ b/js/viz/gauges/linear_gauge.js @@ -74,16 +74,19 @@ var dxLinearGauge = dxGauge.inherit({ _setupCodomain: function() { var that = this, geometry = that.option('geometry') || {}, - vertical = _normalizeEnum(geometry.orientation) === 'vertical'; + vertical = _normalizeEnum(geometry.orientation) === 'vertical', + initialStartCoord = -100, + initialEndCoord = 100; that._area = { vertical: vertical, x: 0, y: 0, - startCoord: -100, - endCoord: 100 + startCoord: initialStartCoord, + endCoord: initialEndCoord }; that._rangeContainer.vertical = vertical; + that._translator.setCodomain(initialStartCoord, initialEndCoord); }, _getScaleLayoutValue: function() { diff --git a/testing/tests/DevExpress.viz.gauges/linearGauge.tests.js b/testing/tests/DevExpress.viz.gauges/linearGauge.tests.js index aaabe387c4ea..f8c515e122f9 100644 --- a/testing/tests/DevExpress.viz.gauges/linearGauge.tests.js +++ b/testing/tests/DevExpress.viz.gauges/linearGauge.tests.js @@ -248,6 +248,22 @@ var TestPointerElement = TestElement.inherit({ assert.equal(axisModule.Axis.getCall(0).returnValue.updateOptions.getCall(1).args[0].label.indentFromAxis, -45, "indent"); }); + QUnit.test("Pass correct base value into indicator", function(assert) { + var gauge = new dxLinearGauge(this.container, { + scale: { + startValue: -1000, + endValue: 1000 + }, + valueIndicator: { + type: "rangebar", + baseValue: 0 + }, + value: 50, + }); + + assert.strictEqual(gauge._valueIndicator.options.baseValue, 0); + }); + QUnit.module("HorizontalGauge - positioning of elements", environment); QUnit.test("Default", function(assert) {