Skip to content

Commit 1f4e151

Browse files
committed
fix(axisPointer): always show for connected charts with null values
1 parent f4c244c commit 1f4e151

File tree

3 files changed

+174
-2
lines changed

3 files changed

+174
-2
lines changed

src/component/axisPointer/axisTrigger.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,13 @@ export default function axisTrigger(
164164
const coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);
165165

166166
each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {
167+
// Allow connected charts to bypass illegalPoint check and always show shared
168+
// axisPointer regardless of series data.
169+
const isAlwaysShow = axisInfo.axisPointerModel.get('show') === 'always';
167170
const axis = axisInfo.axis;
168171
const inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);
169172
// If no inputAxesInfo, no axis is restricted.
170-
if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {
173+
if (isAlwaysShow || !shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {
171174
let val = inputAxisInfo && inputAxisInfo.value;
172175
if (val == null && !isIllegalPoint) {
173176
val = axis.pointToData(point);

src/util/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ type LabelFormatterParams = {
13841384
* Common axis option. can be configured on each axis
13851385
*/
13861386
export interface CommonAxisPointerOption {
1387-
show?: boolean | 'auto'
1387+
show?: boolean | 'auto' | 'always'
13881388

13891389
z?: number;
13901390
zlevel?: number;

test/axis-pointer-sync.html

Lines changed: 169 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)