Skip to content

Commit 25ee62e

Browse files
Chart: apply auto hide point logic only for series with visible points (T1256753) (DevExpress#29143)
1 parent ea2e772 commit 25ee62e

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

packages/devextreme/js/viz/series/scatter_series.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ const baseScatterMethods = {
594594
},
595595

596596
usePointsToDefineAutoHiding() {
597-
return true;
597+
return !!this._getOptionsForPoint().visible;
598598
}
599599
};
600600

packages/devextreme/testing/tests/DevExpress.viz.charts/chart.integration.tests.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,6 +2387,45 @@ QUnit.test('Series should hide the points when all the points are overlapped', f
23872387
assert.ok(series[2].getVisiblePoints()[0].graphic);
23882388
});
23892389

2390+
[true, false].forEach((pointVisible) => {
2391+
QUnit.test(`Series usePointsToDefineAutoHiding method should return ${pointVisible} when series points are ${pointVisible ? 'visible' : 'hidden'} (T1256753)`, function(assert) {
2392+
const dataSource = [{
2393+
country: 'USA',
2394+
val1: 10,
2395+
val2: 10,
2396+
}, {
2397+
country: 'China',
2398+
val1: 10,
2399+
val2: 10,
2400+
}, {
2401+
country: 'Russia',
2402+
val1: 10,
2403+
val2: 10,
2404+
}];
2405+
2406+
const chart = moduleSetup.createChart.call(this, {
2407+
dataSource,
2408+
commonSeriesSettings: {
2409+
argumentField: 'country',
2410+
point: { visible: pointVisible }
2411+
},
2412+
series: [
2413+
{ valueField: 'val1', name: 'val1' },
2414+
],
2415+
});
2416+
2417+
const series = chart.getAllSeries()[0];
2418+
const usePointsToDefineAutoHiding = series.usePointsToDefineAutoHiding;
2419+
const usePointsToDefineAutoHidingSpy = sinon.spy(function() { return usePointsToDefineAutoHiding.apply(series, arguments); });
2420+
2421+
series.usePointsToDefineAutoHiding = usePointsToDefineAutoHidingSpy;
2422+
2423+
chart.resetVisualRange();
2424+
2425+
assert.equal(usePointsToDefineAutoHidingSpy.getCall(0).returnValue, pointVisible);
2426+
});
2427+
});
2428+
23902429
QUnit.test('Series should not hide points when not all points are overlapped in the series', function(assert) {
23912430
const dataSource = [{
23922431
country: 'USA',

0 commit comments

Comments
 (0)