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

Spec modified unexpectedly. #1514

Closed
youngwinds opened this issue Nov 15, 2023 · 0 comments
Closed

Spec modified unexpectedly. #1514

youngwinds opened this issue Nov 15, 2023 · 0 comments
Assignees
Labels
bp bug Something isn't working fixed
Milestone

Comments

@youngwinds
Copy link
Contributor

youngwinds commented Nov 15, 2023

Image
spec.data被异常修改, 多出来了一个type和_domainCache

const spec = {
    height:150,
    "type": "scatter",
    "xField": "231114203244032",
    "yField": "231114203244035",
    "invalidType": "ignore",
    "region": [
        {
            "clip": true
        }
    ],
    "padding": 0,
    "labelLayout": "region",
    "data": [
        {
            "id": "data",
            "values": [
                {
                    "30001": "一级 ------- ------- ------- ------- -------",
                    "231114203244032": "2403392.6722841263",
                    "231114203244035": "5582",
                    "231114203244038": "一级 ------- ------- ------- ------- -------",
                    "231114203244043": "2403392.6722841263",
                    "231114203244046": "276281.10993189365"
                },
                {
                    "30001": "当日",
                    "231114203244032": "827490.930524826",
                    "231114203244035": "1840",
                    "231114203244038": "当日",
                    "231114203244043": "827490.930524826",
                    "231114203244046": "134374.30981696397"
                },
                {
                    "30001": "标准级",
                    "231114203244032": "9339292.830370903",
                    "231114203244035": "21928",
                    "231114203244038": "标准级",
                    "231114203244043": "9339292.830370903",
                    "231114203244046": "1260994.3519947156"
                },
                {
                    "30001": "二级",
                    "231114203244032": "3498777.6997537613",
                    "231114203244035": "8184",
                    "231114203244038": "二级",
                    "231114203244043": "3498777.6997537613",
                    "231114203244046": "475889.1553846523"
                }
            ],
            "fields": {
                "30001": {
                    "alias": "图例项 "
                },
                "231114203244032": {
                    "alias": "销售额"
                },
                "231114203244035": {
                    "alias": "数量"
                },
                "231114203244038": {
                    "alias": "邮寄方式"
                },
                "231114203244043": {
                    "alias": "销售额",
                    "domain": [
                        "2403392.6722841263",
                        "827490.930524826",
                        "9339292.830370903",
                        "3498777.6997537613"
                    ]
                },
                "231114203244046": {
                    "alias": "利润"
                }
            }
        }
    ],
    "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": false,
                "text": "数量",
                "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,
            "expand": {
                "max": 0.017
            }
        },
        {
            "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": false,
                "text": "销售额",
                "space": 8,
                "style": {
                    "fontSize": 12,
                    "fill": "#363839",
                    "fontWeight": "normal"
                }
            },
            "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,
            "expand": {
                "max": 0.017
            }
        }
    ],
    "label": {
        "visible": false,
        "offset": 6,
        "overlap": {
            "hideOnHit": true,
            "avoidBaseMark": false,
            "strategy": [
                {
                    "type": "position",
                    "position": [
                        "top",
                        "bottom"
                    ]
                },
                {
                    "type": "moveY",
                    "offset": [
                        -5,
                        -4,
                        -3,
                        -2,
                        -1,
                        0,
                        1,
                        2,
                        3,
                        4,
                        5
                    ]
                },
                {
                    "type": "moveX",
                    "offset": [
                        -5,
                        -4,
                        -3,
                        -2,
                        -1,
                        0,
                        1,
                        2,
                        3,
                        4,
                        5
                    ]
                }
            ],
            "clampForce": true
        },
        "style": {
            "fontSize": 12,
            "fontWeight": "normal",
            "zIndex": 400,
            "lineHeight": "100%",
            "fill": "#363839",
            "stroke": "rgba(255, 255, 255, 0.8)",
            "lineWidth": 1,
            "strokeOpacity": 1
        },
        "position": "top"
    },
    "legends": [
        {
            "type": "color",
            "slidable": true,
            "title": {
                "visible": true,
                "text": "销售额",
                "textStyle": {
                    "fontSize": 12,
                    "fill": "#6F6F6F"
                },
                "space": 0
            },
            "id": "legend-color",
            "orient": "right",
            "position": "start",
            "layoutType": "normal-inline",
            "visible": true,
            "field": [
                "231114203244043"
            ],
            "layoutLevel": 50,
            "maxHeight": 130,
            "rail": {
                "height": 100
            },
            "handler": {
                "style": {
                    "shadowBlur": 5,
                    "shadowColor": false
                }
            },
            "handlerText": {
                "style": {
                    "maxLineWidth": 50,
                    "fontSize": 12,
                    "fill": "#6F6F6F"
                }
            },
            "startText": {
                "visible": false
            },
            "endText": {
                "visible": false
            },
            "padding": {
                "top": 0,
                "bottom": 12,
                "left": 23,
                "right": 0
            }
        },
        {
            "type": "size",
            "slidable": true,
            "title": {
                "visible": true,
                "text": "利润",
                "textStyle": {
                    "fontSize": 12,
                    "fill": "#6F6F6F"
                },
                "space": 0
            },
            "handlerText": {
                "style": {
                    "maxLineWidth": 50,
                    "fontSize": 12,
                    "fill": "#6F6F6F"
                }
            },
            "id": "legend-size",
            "orient": "right",
            "position": "start",
            "layoutType": "normal-inline",
            "visible": true,
            "field": [
                "231114203244046"
            ],
            "layoutLevel": 50,
            "maxHeight": 130,
            "track": {
                "style": {
                    "fill": "rgba(20,20,20,0.1)"
                }
            },
            "rail": {
                "height": 100
            },
            "handler": {
                "style": {
                    "symbolType": "M-5,0L-2.5,-3.5\n    h5\n    v7\n    h-5\n    Z",
                    "size": 8,
                    "shadowBlur": 0,
                    "shadowColor": false,
                    "outerBorder": {
                        "stroke": "#AEB8C6",
                        "lineWidth": 1,
                        "strokeOpacity": 0.5
                    }
                }
            },
            "startText": {
                "visible": false
            },
            "endText": {
                "visible": false
            },
            "padding": {
                "top": 0,
                "bottom": 12,
                "left": 23,
                "right": 0
            }
        }
    ],
    "seriesField": "231114203244043",
    "color": {
        "field": "231114203244043",
        "type": "linear",
        "range": [
            "#b2e3ff",
            "#0050b3"
        ],
        "domain": [
            {
                "dataId": "data",
                "fields": [
                    "231114203244043"
                ]
            }
        ]
    },
    "sizeField": "231114203244046",
    "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,
            "colorAlpha": 1
        },
        "outOfBrush": {
            "colorAlpha": 0.2,
            "fillOpacity": 0.3,
            "strokeWidth": 0.3
        }
    },
    "hash": "420ff807d49a62c447bf64603f7f2e61"
}

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

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;

window['spec']=spec
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 fixed
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants