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] 瀑布图标签失效. #1897

Closed
youngwinds opened this issue Jan 3, 2024 · 0 comments · Fixed by #1898
Closed

[Bug] 瀑布图标签失效. #1897

youngwinds opened this issue Jan 3, 2024 · 0 comments · Fixed by #1898
Assignees
Labels
bp bug Something isn't working

Comments

@youngwinds
Copy link
Contributor

1.8.3版本失效.
1.6.0版本生效.

const spec = {
    "type": "waterfall",
    "xField": [
        "221111155506027"
    ],
    "yField": [
        "10002"
    ],
    "direction": "vertical",
    "sortDataByAxis": true,
    "seriesField": "type",
    "padding": 0,
    "labelLayout": "region",
    "data": [
        {
            "id": "data",
            "values": [
                {
                    "10001": "Spending(RMB)",
                    "10002": "19762198935.9852",
                    "10003": "221014210343027",
                    "20001": "Spending(RMB)",
                    "221014210343027": "19762198935.9852",
                    "221111155506027": "CN",
                    "type": "increase"
                },
                {
                    "10001": "Spending(RMB)",
                    "10002": "5001315838.9444065",
                    "10003": "221014210343027",
                    "20001": "Spending(RMB)",
                    "221014210343027": "5001315838.9444065",
                    "221111155506027": "GLOBAL",
                    "type": "increase"
                },
                {
                    "10001": "Spending(RMB)",
                    "10002": "2595563991.5543256",
                    "10003": "221014210343027",
                    "20001": "Spending(RMB)",
                    "221014210343027": "2595563991.5543256",
                    "221111155506027": "AMS",
                    "type": "increase"
                },
                {
                    "10001": "Spending(RMB)",
                    "10002": "1709170858.3951967",
                    "10003": "221014210343027",
                    "20001": "Spending(RMB)",
                    "221014210343027": "1709170858.3951967",
                    "221111155506027": "SEA",
                    "type": "increase"
                },
                {
                    "10001": "Spending(RMB)",
                    "10002": "1640902362.9384427",
                    "10003": "221014210343027",
                    "20001": "Spending(RMB)",
                    "221014210343027": "1640902362.9384427",
                    "221111155506027": "EMEA",
                    "type": "increase"
                },
                {
                    "10001": "Spending(RMB)",
                    "10002": "558559187.7495197",
                    "10003": "221014210343027",
                    "20001": "Spending(RMB)",
                    "221014210343027": "558559187.7495197",
                    "221111155506027": "NEA",
                    "type": "increase"
                },
                {
                    "10001": "Spending(RMB)",
                    "10002": "1635700.3446600002",
                    "10003": "221014210343027",
                    "20001": "Spending(RMB)",
                    "221014210343027": "1635700.3446600002",
                    "221111155506027": "未分类",
                    "type": "increase"
                },
                {
                    "10001": "Spending(RMB)",
                    "10002": "31269346875.911747",
                    "10003": "221014210343027",
                    "20001": "Spending(RMB)",
                    "221014210343027": "19762198935.9852",
                    "221111155506027": "总计",
                    "type": "total",
                    "isTotal": true
                }
            ],
            "fields": {
                "10001": {
                    "alias": "指标名称 "
                },
                "10002": {
                    "alias": "指标值 "
                },
                "20001": {
                    "alias": "图例项 ",
                    "domain": [
                        "Spending(RMB)"
                    ],
                    "lockStatisticsByDomain": true
                },
                "221014210343027": {
                    "alias": "Spending(RMB)"
                },
                "221111155506027": {
                    "alias": "支付区域",
                    "domain": [
                        "CN",
                        "GLOBAL",
                        "AMS",
                        "SEA",
                        "EMEA",
                        "NEA",
                        "未分类",
                        "总计"
                    ],
                    "lockStatisticsByDomain": true,
                    "sortIndex": 0
                }
            }
        }
    ],
    "color": {
        "field": "type",
        "type": "ordinal",
        "domain": [
            "increase",
            "total"
        ],
        "range": [
            "#FF0050",
            "#221F20"
        ]
    },
    "total": {
        "type": "field",
        "tagField": "isTotal",
        "valueField": "10002"
    },
    "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",
                    "maxLineWidth": 174
                },
                "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.36249999999999993,
            "paddingOuter": 0.175
        },
        {
            "type": "linear",
            "tick": {
                "visible": false,
                "tickMode": "d3",
                "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": "Spending(RMB)",
                "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"
            },
            "background": {
                "visible": true,
                "state": {
                    "hover": {
                        "fillOpacity": 0.08,
                        "fill": "#141414"
                    },
                    "hover_reverse": {
                        "fillOpacity": 0.08,
                        "fill": "#141414"
                    }
                }
            },
            "zero": true,
            "nice": true
        }
    ],
    "label": {
        "visible": true,
        "offset": 3,
        "overlap": {
            "hideOnHit": true,
            "avoidBaseMark": false,
            "strategy": [
                {
                    "type": "position",
                    "position": []
                }
            ],
            "clampForce": true
        },
        "style": {
            "fontSize": 12,
            "fontWeight": "normal",
            "zIndex": 400,
            "lineHeight": "100%",
            "fill": "#363839",
            "lineWidth": 1.5,
            "strokeOpacity": 1
        },
        "position": "inside",
        "smartInvert": {
            "fillStrategy": "invertBase",
            "strokeStrategy": "similarBase",
            "outsideEnable": true,
            "mode": "lightness"
        }
    },
    "stackLabel": {
        "visible": false
    },
    "leaderLine": {
        "style": {
            "lineDash": [
                1,
                1
            ]
        }
    },
    "region": [
        {
            "clip": true
        }
    ],
    "background": "rgba(255, 255, 255, 0)",
    "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
            }
        }
    },
    "animation": false,
    "hash": "4b6100c681b403c89209a4683682f058"
}

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderAsync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
@youngwinds youngwinds added bug Something isn't working bp labels Jan 3, 2024
xile611 added a commit that referenced this issue Jan 3, 2024
fix: waterfall.label not work, closes #1897
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
Development

Successfully merging a pull request may close this issue.

3 participants