Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/devextreme/js/__internal/viz/m_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,15 @@ const dxChart = AdvancedChart.inherit({
_handleSeriesDataUpdated() {
const viewport = new Range();

this._argumentAxes.forEach((axis) => {
if (Array.isArray(axis._majorTicks)) {
axis._majorTicks.forEach((tick) => tick.removeLabel && tick.removeLabel());
}
if (Array.isArray(axis._minorTicks)) {
axis._minorTicks.forEach((tick) => tick.removeLabel && tick.removeLabel());
}
});

this.series.forEach((s) => {
viewport.addRange(s.getArgumentRange());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,36 @@ QUnit.test('Using the single section of axis options for some panes (check custo
assert.deepEqual(visualRangeChanged.getCall(2).args[0].value, { startValue: 18, endValue: 25 });
});

// T1317590
QUnit.test('Argument axis overlays/labels are removed when dataSource update', function(assert) {
const initialData = [
{ arg: 'Monday', val: 1 },
{ arg: 'Friday', val: 2 }
];
const updatedData = [
{ arg: 'Tuesday', val: 3 },
{ arg: 'Thursday', val: 4 }
];

const chart = this.createChart({
dataSource: initialData,
series: { argumentField: 'arg', valueField: 'val' },
argumentAxis: { label: { visible: true } }
});

let label = this.$container.find('.dxc-arg-elements text').filter(function() {
return $(this).text() === 'Friday';
});
assert.ok(label.length, 'Friday label exists');

chart.option('dataSource', updatedData);

label = this.$container.find('.dxc-arg-elements text').filter(function() {
return $(this).text() === 'Friday';
});
assert.notOk(label.length, 'Friday label is not exists');
});

// T681674
QUnit.test('actual value axis visualRange after dataSource updating (argument axis without visual range)', function(assert) {
const chart = this.createChart({
Expand Down
Loading