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] scatter linear color error #2131

Closed
youngwinds opened this issue Jan 24, 2024 · 0 comments
Closed

[Bug] scatter linear color error #2131

youngwinds opened this issue Jan 24, 2024 · 0 comments
Assignees
Labels
bp bug Something isn't working

Comments

@youngwinds
Copy link
Contributor

1.5.4:

Image

1.6.0:

Image

const spec = {
    "type": "scatter",
    "xField": "231121160842252",
    "yField": "231127103657009",
    "invalidType": "ignore",
    "region": [
        {
            "clip": true
        }
    ],
    "padding": 0,
    "labelLayout": "region",
    "data": [
        {
            "id": "data",
            "values": [
                {
                    "30001": "CCAAAAQQ(CCAAAAQQQQ)",
                    "231121160842199": "CCAAAAQQ(CCAAAAQQQQ)",
                    "231121160842252": "2.757575757575758",
                    "231121160842421": "127923.2",
                    "231127103657009": "33",
                    "240124130736013": "3.0612166805696925e-05"
                },
                {
                    "30001": "asd1asd1",
                    "231121160842199": "asd1asd1",
                    "231121160842252": "2",
                    "231121160842421": "39.8",
                    "231127103657009": "1",
                    "240124130736013": "1.3686293724286876e-07"
                },
                {
                    "30001": "CC",
                    "231121160842199": "CC",
                    "231121160842252": "1.7857142857142858",
                    "231121160842421": "168",
                    "231127103657009": "14",
                    "240124130736013": "1.1466081896489946e-05"
                },
                {
                    "30001": "CCa",
                    "231121160842199": "CCa",
                    "231121160842252": "1.3333333333333333",
                    "231121160842421": "10",
                    "231127103657009": "1",
                    "240124130736013": "3.773108402410563e-07"
                },
                {
                    "30001": "CCaAS123(CCaAS)",
                    "231121160842199": "CCaAS123(CCaAS)",
                    "231121160842252": "1.3333333333333333",
                    "231121160842421": "36",
                    "231127103657009": "6",
                    "240124130736013": "8.982809148991119e-07"
                },
                {
                    "30001": "CCaAS123123",
                    "231121160842199": "CCaAS123123",
                    "231121160842252": "1.2028503562945367",
                    "231121160842421": "2994",
                    "231127103657009": "300.7142857142857",
                    "240124130736013": "4.2894232962382044e-05"
                },
                {
                    "30001": "asd1(asd1asd)",
                    "231121160842199": "asd1(asd1asd)",
                    "231121160842252": "1",
                    "231121160842421": "49.9",
                    "231127103657009": "5",
                    "240124130736013": "2.275680485357134e-06"
                },
                {
                    "30001": "asddsa121acasdc(asddsa121acasdc123)",
                    "231121160842199": "asddsa121acasdc(asddsa121acasdc123)",
                    "231121160842252": "1",
                    "231121160842421": "319.2",
                    "231127103657009": "8",
                    "240124130736013": "1.12031207413137e-06"
                },
                {
                    "30001": "asddsa121a(asddsa121acc)",
                    "231121160842199": "asddsa121a(asddsa121acc)",
                    "231121160842252": "1",
                    "231121160842421": "9.9",
                    "231127103657009": "4",
                    "240124130736013": "3.335740626151873e-06"
                },
                {
                    "30001": "121a",
                    "231121160842199": "121a",
                    "231121160842252": "1",
                    "231121160842421": "700",
                    "231127103657009": "1",
                    "240124130736013": null
                }
            ],
            "fields": {
                "30001": {
                    "alias": "图例项 "
                },
                "231121160842199": {
                    "alias": "TT名称"
                },
                "231121160842252": {
                    "alias": "TT-asd1asd1aaaa(aasx+aasxxxx)"
                },
                "231121160842421": {
                    "alias": "TT-CCAAAA(CCAAAAQQ)"
                },
                "231127103657009": {
                    "alias": "TT-asd1asd1a(asd1asd1aa)"
                },
                "240124130736013": {
                    "alias": "TT-CC(CCAA)",
                    "domain": [
                        "3.0612166805696925e-05",
                        "1.3686293724286876e-07",
                        "1.1466081896489946e-05",
                        "3.773108402410563e-07",
                        "8.982809148991119e-07",
                        "4.2894232962382044e-05",
                        "2.275680485357134e-06",
                        "1.12031207413137e-06",
                        "3.335740626151873e-06",
                        "None"
                    ]
                }
            }
        }
    ],
    "axes": [
        {
            "type": "linear",
            "tick": {
                "visible": false,
                "tickMode": "d3",
                "style": {
                    "stroke": "#8D8D8D"
                }
            },
            "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": "#8D8D8D"
                }
            },
            "title": {
                "visible": true,
                "text": "TT-asd1asd1a(asd1asd1aa)",
                "space": 8,
                "style": {
                    "fontSize": 12,
                    "fill": "#363839",
                    "fontWeight": "normal"
                }
            },
            "autoIndent": false,
            "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
        },
        {
            "type": "linear",
            "tick": {
                "visible": false,
                "tickMode": "d3",
                "style": {
                    "stroke": "#8D8D8D"
                }
            },
            "niceType": "accurateFirst",
            "zIndex": 200,
            "grid": {
                "visible": true,
                "style": {
                    "zIndex": 150,
                    "stroke": "#DADCDD",
                    "lineWidth": 1,
                    "lineDash": [
                        4,
                        2
                    ]
                }
            },
            "orient": "bottom",
            "visible": true,
            "domainLine": {
                "visible": true,
                "style": {
                    "lineWidth": 1,
                    "stroke": "#8D8D8D"
                }
            },
            "title": {
                "visible": true,
                "text": "TT-asd1asd1aaaa(aasx+aasxxxx)",
                "space": 8,
                "style": {
                    "fontSize": 12,
                    "fill": "#363839",
                    "fontWeight": "normal"
                }
            },
            "autoIndent": false,
            "sampling": false,
            "label": {
                "visible": true,
                "space": 4,
                "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": false,
        "offset": 6,
        "overlap": {
            "hideOnHit": true,
            "avoidBaseMark": false,
            "strategy": [
                {
                    "type": "position",
                    "position": [
                        "top",
                        "bottom"
                    ]
                }
            ],
            "clampForce": true
        },
        "style": {
            "fontSize": 12,
            "fontWeight": "normal",
            "zIndex": 400,
            "lineHeight": "100%",
            "fill": "#363839",
            "stroke": "rgba(255, 255, 255, 0.8)",
            "lineWidth": 2,
            "strokeOpacity": 1
        },
        "position": "top"
    },
    "legends": [
        {
            "type": "color",
            "slidable": true,
            "title": {
                "visible": true,
                "text": "TT-CC(CCAA)"
            },
            "visible": false,
            "handlerText": {}
        },
        {
            "type": "size",
            "slidable": true,
            "visible": false,
            "title": {
                "visible": true,
                "text": "TT-CCAAAA(CCAAAAQQ)"
            },
            "handlerText": {}
        }
    ],
    "seriesField": "240124130736013",
    "color": {
        "field": "240124130736013",
        "type": "linear",
        "range": [
            "red",
            "blue"
        ],
        "domain": [
            {
                "dataId": "data",
                "fields": [
                    "240124130736013"
                ]
            }
        ]
    },
    "sizeField": "231121160842421",
    "size": {
        "type": "linear",
        "range": [
            7.0898154036220635,
            28.359261614488254
        ]
    },
    "tooltip": {
        "handler": {}
    },
    "point": {
        "state": {
            "hover": {
                "cursor": "pointer",
                "fillOpacity": 0.8,
                "stroke": "#58595B",
                "lineWidth": 1,
                "zIndex": 500
            }
        }
    },
    "background": "rgba(255, 255, 255, 0)",
    "hover": {
        "enable": true
    },
    "select": {
        "enable": true
    },
    "animation": false,
    "brush": {
        "inBrush": {
            "fillOpacity": 1,
            "stroke": "#58595B",
            "lineWidth": 1,
            "strokeOpacity": 1,
            "colorAlpha": 1
        },
        "outOfBrush": {
            "colorAlpha": 0.2,
            "fillOpacity": 0.3,
            "lineWidth": 0.3
        }
    },
    "hash": "a528a70a9b6a799187a27ce0cdaa0ca9"
}

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 24, 2024
xile611 added a commit that referenced this issue Jan 25, 2024
fix: fix issue of continous color scale, close #2131
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

No branches or pull requests

3 participants