Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 图表初始化后第一次点击mark,不会触发click事件 #1129

Closed
da730 opened this issue Oct 8, 2023 · 1 comment · Fixed by #1182 or #1289
Closed

[Bug] 图表初始化后第一次点击mark,不会触发click事件 #1129

da730 opened this issue Oct 8, 2023 · 1 comment · Fixed by #1182 or #1289
Assignees
Labels
bp bug Something isn't working

Comments

@da730
Copy link
Contributor

da730 commented Oct 8, 2023

Version

1.4.0

Link to Minimal Reproduction

null

Steps to Reproduce

{
    "type": "bar",
    "xField": [
        "230922161103013",
        "20001"
    ],
    "yField": [
        "10002"
    ],
    "direction": "vertical",
    "sortDataByAxis": true,
    "seriesField": "20001",
    "padding": 0,
    "labelLayout": "region",
    "data": [
        {
            "id": "data",
            "values": [
                {
                    "10001": "行 ID",
                    "10002": "4933854",
                    "10003": "230922161103019",
                    "20001": "办公-行 ID",
                    "230922161103013": "小型企业",
                    "230922161103019": "4933854",
                    "230922174525033": "办公"
                },
                {
                    "10001": "销售额",
                    "10002": "837464.545838356",
                    "10003": "230922161103016",
                    "20001": "办公-销售额",
                    "230922161103013": "小型企业",
                    "230922161103016": "837464.545838356",
                    "230922174525033": "办公"
                },
                {
                    "10001": "行 ID",
                    "10002": "14721235",
                    "10003": "230922161103019",
                    "20001": "办公-行 ID",
                    "230922161103013": "消费者",
                    "230922161103019": "14721235",
                    "230922174525033": "办公"
                },
                {
                    "10001": "销售额",
                    "10002": "2543529.3300714493",
                    "10003": "230922161103016",
                    "20001": "办公-销售额",
                    "230922161103013": "消费者",
                    "230922161103016": "2543529.3300714493",
                    "230922174525033": "办公"
                },
                {
                    "10001": "行 ID",
                    "10002": "4905157",
                    "10003": "230922161103019",
                    "20001": "技术-行 ID",
                    "230922161103013": "消费者",
                    "230922161103019": "4905157",
                    "230922174525033": "技术"
                },
                {
                    "10001": "销售额",
                    "10002": "2692828.4352111816",
                    "10003": "230922161103016",
                    "20001": "技术-销售额",
                    "230922161103013": "消费者",
                    "230922161103016": "2692828.4352111816",
                    "230922174525033": "技术"
                },
                {
                    "10001": "行 ID",
                    "10002": "8795638",
                    "10003": "230922161103019",
                    "20001": "办公-行 ID",
                    "230922161103013": "公司",
                    "230922161103019": "8795638",
                    "230922174525033": "办公"
                },
                {
                    "10001": "销售额",
                    "10002": "1484595.9238786697",
                    "10003": "230922161103016",
                    "20001": "办公-销售额",
                    "230922161103013": "公司",
                    "230922161103016": "1484595.9238786697",
                    "230922174525033": "办公"
                },
                {
                    "10001": "行 ID",
                    "10002": "5989411",
                    "10003": "230922161103019",
                    "20001": "家具-行 ID",
                    "230922161103013": "消费者",
                    "230922161103019": "5989411",
                    "230922174525033": "家具"
                },
                {
                    "10001": "销售额",
                    "10002": "2788714.4288902283",
                    "10003": "230922161103016",
                    "20001": "家具-销售额",
                    "230922161103013": "消费者",
                    "230922161103016": "2788714.4288902283",
                    "230922174525033": "家具"
                },
                {
                    "10001": "行 ID",
                    "10002": "2020565",
                    "10003": "230922161103019",
                    "20001": "家具-行 ID",
                    "230922161103013": "小型企业",
                    "230922161103019": "2020565",
                    "230922174525033": "家具"
                },
                {
                    "10001": "销售额",
                    "10002": "1042003.6409912109",
                    "10003": "230922161103016",
                    "20001": "家具-销售额",
                    "230922161103013": "小型企业",
                    "230922161103016": "1042003.6409912109",
                    "230922174525033": "家具"
                },
                {
                    "10001": "行 ID",
                    "10002": "3247362",
                    "10003": "230922161103019",
                    "20001": "技术-行 ID",
                    "230922161103013": "公司",
                    "230922161103019": "3247362",
                    "230922174525033": "技术"
                },
                {
                    "10001": "销售额",
                    "10002": "1764574.614578247",
                    "10003": "230922161103016",
                    "20001": "技术-销售额",
                    "230922161103013": "公司",
                    "230922161103016": "1764574.614578247",
                    "230922174525033": "技术"
                },
                {
                    "10001": "行 ID",
                    "10002": "3384905",
                    "10003": "230922161103019",
                    "20001": "家具-行 ID",
                    "230922161103013": "公司",
                    "230922161103019": "3384905",
                    "230922174525033": "家具"
                },
                {
                    "10001": "销售额",
                    "10002": "1903622.758113861",
                    "10003": "230922161103016",
                    "20001": "家具-销售额",
                    "230922161103013": "公司",
                    "230922161103016": "1903622.758113861",
                    "230922174525033": "家具"
                },
                {
                    "10001": "行 ID",
                    "10002": "1818217",
                    "10003": "230922161103019",
                    "20001": "技术-行 ID",
                    "230922161103013": "小型企业",
                    "230922161103019": "1818217",
                    "230922174525033": "技术"
                },
                {
                    "10001": "销售额",
                    "10002": "1011620.4553604126",
                    "10003": "230922161103016",
                    "20001": "技术-销售额",
                    "230922161103013": "小型企业",
                    "230922161103016": "1011620.4553604126",
                    "230922174525033": "技术"
                }
            ],
            "fields": {
                "10001": {
                    "alias": "指标名称 "
                },
                "10002": {
                    "alias": "指标值 "
                },
                "20001": {
                    "alias": "图例项 ",
                    "domain": [
                        "办公-行 ID",
                        "技术-行 ID",
                        "家具-行 ID",
                        "办公-销售额",
                        "技术-销售额",
                        "家具-销售额"
                    ],
                    "sortIndex": 0,
                    "lockStatisticsByDomain": true
                },
                "230922161103013": {
                    "alias": "细分",
                    "domain": [
                        "公司",
                        "消费者",
                        "小型企业"
                    ],
                    "sortIndex": 0,
                    "lockStatisticsByDomain": true
                },
                "230922161103016": {
                    "alias": "销售额"
                },
                "230922161103019": {
                    "alias": "行 ID"
                },
                "230922174525033": {
                    "alias": "类别"
                }
            }
        }
    ],
    "stackInverse": true,
    "axes": [
        {
            "type": "band",
            "tick": {
                "visible": false
            },
            "grid": {
                "visible": false,
                "style": {
                    "zIndex": 150,
                    "stroke": "#DADCDD",
                    "lineWidth": 1,
                    "lineDash": [
                        4,
                        2
                    ]
                }
            },
            "orient": "bottom",
            "visible": true,
            "domainLine": {
                "visible": true,
                "style": {
                    "lineWidth": 1,
                    "stroke": "#989999"
                }
            },
            "title": {
                "visible": false,
                "space": 5,
                "text": "细分",
                "style": {
                    "fontSize": 12,
                    "fill": "#363839",
                    "fontWeight": "normal"
                }
            },
            "sampling": false,
            "zIndex": 200,
            "label": {
                "visible": true,
                "space": 4,
                "style": {
                    "fontSize": 12,
                    "fill": "#6F6F6F",
                    "angle": 0,
                    "fontWeight": "normal",
                    "direction": "horizontal"
                },
                "autoHide": true,
                "autoHideMethod": "greedy",
                "flush": true
            },
            "hover": true,
            "background": {
                "visible": true,
                "state": {
                    "hover": {
                        "fillOpacity": 0.08,
                        "fill": "#141414"
                    },
                    "hover_reverse": {
                        "fillOpacity": 0.08,
                        "fill": "#141414"
                    }
                }
            },
            "paddingInner": [
                0.15,
                0.1
            ],
            "paddingOuter": [
                0.075,
                0.1
            ]
        },
        {
            "type": "linear",
            "tick": {
                "visible": false,
                "style": {
                    "stroke": "rgba(255, 255, 255, 0)"
                }
            },
            "niceType": "accurateFirst",
            "zIndex": 200,
            "grid": {
                "visible": true,
                "style": {
                    "zIndex": 150,
                    "stroke": "#DADCDD",
                    "lineWidth": 1,
                    "lineDash": [
                        4,
                        2
                    ]
                }
            },
            "orient": "left",
            "visible": true,
            "domainLine": {
                "visible": true,
                "style": {
                    "lineWidth": 1,
                    "stroke": "rgba(255, 255, 255, 0)"
                }
            },
            "title": {
                "visible": false,
                "text": "行 ID",
                "space": 8,
                "style": {
                    "fontSize": 12,
                    "fill": "#363839",
                    "fontWeight": "normal"
                }
            },
            "sampling": false,
            "label": {
                "visible": true,
                "space": 6,
                "flush": true,
                "padding": 0,
                "style": {
                    "fontSize": 12,
                    "maxLineWidth": 174,
                    "fill": "#6F6F6F",
                    "angle": 0,
                    "fontWeight": "normal",
                    "dy": -1,
                    "direction": "horizontal"
                },
                "autoHide": true,
                "autoHideMethod": "greedy"
            },
            "hover": true,
            "background": {
                "visible": true,
                "state": {
                    "hover": {
                        "fillOpacity": 0.08,
                        "fill": "#141414"
                    },
                    "hover_reverse": {
                        "fillOpacity": 0.08,
                        "fill": "#141414"
                    }
                }
            },
            "zero": true,
            "nice": true
        }
    ],
    "color": {
        "field": "20001",
        "type": "ordinal",
        "range": [
            "#2E62F1",
            "#4DC36A",
            "#FF8406",
            "#FFCC00",
            "#4F44CF",
            "#5AC8FA"
        ],
        "specified": {},
        "domain": [
            "办公-行 ID",
            "技术-行 ID",
            "家具-行 ID",
            "办公-销售额",
            "技术-销售额",
            "家具-销售额"
        ]
    },
    "legends": [
        {
            "type": "discrete",
            "id": "legend-discrete",
            "orient": "right",
            "position": "start",
            "layoutType": "normal",
            "visible": true,
            "maxCol": 1,
            "title": {
                "textStyle": {
                    "fontSize": 12,
                    "fill": "#6F6F6F"
                }
            },
            "layoutLevel": 60,
            "item": {
                "focus": true,
                "focusIconStyle": {
                    "size": 14
                },
                "maxWidth": 324,
                "spaceRow": 0,
                "spaceCol": 0,
                "padding": {
                    "top": 1,
                    "bottom": 2,
                    "left": 3,
                    "right": 2
                },
                "background": {
                    "visible": false,
                    "style": {
                        "fillOpacity": 0.001
                    }
                },
                "label": {
                    "style": {
                        "fontSize": 12,
                        "fill": "#6F6F6F"
                    }
                },
                "shape": {
                    "style": {
                        "lineWidth": 0,
                        "symbolType": "square"
                    }
                }
            },
            "pager": {
                "layout": "horizontal",
                "padding": {
                    "left": -18
                },
                "textStyle": {},
                "space": 0,
                "handler": {
                    "preShape": "triangleLeft",
                    "nextShape": "triangleRight",
                    "style": {},
                    "state": {
                        "disable": {}
                    }
                }
            },
            "padding": {
                "top": 0,
                "bottom": 0,
                "left": 16,
                "right": 0
            }
        }
    ],
    "label": {
        "visible": true,
        "overlap": {
            "hideOnHit": true,
            "avoidBaseMark": false,
            "strategy": [
                {
                    "type": "moveY",
                    "offset": [
                        -20,
                        -19,
                        -18,
                        -17,
                        -16,
                        -15,
                        -14,
                        -13,
                        -12,
                        -11,
                        -10,
                        -9,
                        -8,
                        -7,
                        -6,
                        -5,
                        -4,
                        -3,
                        -2,
                        -1,
                        0,
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20
                    ]
                },
                {
                    "type": "moveX",
                    "offset": [
                        -20,
                        -19,
                        -18,
                        -17,
                        -16,
                        -15,
                        -14,
                        -13,
                        -12,
                        -11,
                        -10,
                        -9,
                        -8,
                        -7,
                        -6,
                        -5,
                        -4,
                        -3,
                        -2,
                        -1,
                        0,
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20
                    ]
                }
            ],
            "clampForce": true
        },
        "style": {
            "fontSize": 12,
            "fontWeight": "normal",
            "zIndex": 400,
            "fill": null,
            "strokeOpacity": 1
        },
        "position": "inside",
        "smartInvert": {
            "fillStrategy": "invertBase",
            "strokeStrategy": "similarBase"
        }
    },
    "tooltip": {
        "handler": {}
    },
    "hover": {
        "enable": true
    },
    "select": {
        "enable": true
    },
    "bar": {
        "state": {
            "hover": {
                "cursor": "pointer",
                "fillOpacity": 0.8,
                "stroke": "#58595B",
                "lineWidth": 1,
                "zIndex": 500
            },
            "selected": {
                "cursor": "pointer",
                "fillOpacity": 1,
                "stroke": "#58595B",
                "lineWidth": 1
            },
            "selected_reverse": {
                "fillOpacity": 0.3,
                "strokeWidth": 0.3
            }
        }
    },
    "region": [
        {
            "clip": true
        }
    ],
    "background": "rgba(255, 255, 255, 0)",
    "animation": false,
    "brush": {
        "inBrush": {
            "fillOpacity": 1,
            "stroke": "#58595B",
            "lineWidth": 1,
            "colorAlpha": 1
        },
        "outOfBrush": {
            "colorAlpha": 0.2,
            "fillOpacity": 0.3,
            "strokeWidth": 0.3
        }
    },
    "hash": "9cced9bc1023adbc3768fd4a2044b75d"
}

Current Behavior

点击mark后不会触发选中状态,也不会触发click事件。第一次点击后hover事件也不会触发。需要在mark外面brush一下,才能正常触发click和hover

Expected Behavior

正常触发事件

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@da730
Copy link
Contributor Author

da730 commented Oct 24, 2023

1.5.2又复现了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bp bug Something isn't working
Projects
None yet
2 participants