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] InvalidType error in radar chart #867

Closed
youngwinds opened this issue Sep 8, 2023 · 1 comment
Closed

[Bug] InvalidType error in radar chart #867

youngwinds opened this issue Sep 8, 2023 · 1 comment
Assignees
Labels
bp bug Something isn't working
Milestone

Comments

@youngwinds
Copy link
Contributor

youngwinds commented Sep 8, 2023

Image

import { default as VChart } from '../../../../src/index';

const spec = {
    "type": "radar",
    "outerRadius": 0.8,
    "padding": 0,
    "categoryField": "230908112750023",
    "valueField": "10002",
    "seriesField": "20001",
    "data": [
        {
            "id": "data",
            "values": [
                {
                    "10001": "销售额-存在空",
                    "10002": "2447301.0141382217",
                    "10003": "230908112750009",
                    "20001": "销售额-存在空",
                    "230908112750009": "2447301.0141382217",
                    "230908112750023": "华北"
                },
                {
                    "10001": "销售额-存在空",
                    "10002": null,
                    "10003": "230908112750009",
                    "20001": "销售额-存在空",
                    "230908112750009": null,
                    "230908112750023": "华东"
                },
                {
                    "10001": "销售额-存在空",
                    "10002": "815039.5979347229",
                    "10003": "230908112750009",
                    "20001": "销售额-存在空",
                    "230908112750009": "815039.5979347229",
                    "230908112750023": "西北"
                },
                {
                    "10001": "销售额-存在空",
                    "10002": "2681567.4745378494",
                    "10003": "230908112750009",
                    "20001": "销售额-存在空",
                    "230908112750009": "2681567.4745378494",
                    "230908112750023": "地区-dongbei"
                },
                {
                    "10001": "销售额-存在空",
                    "10002": "1303124.5089645386",
                    "10003": "230908112750009",
                    "20001": "销售额-存在空",
                    "230908112750009": "1303124.5089645386",
                    "230908112750023": "西南"
                },
                {
                    "10001": "销售额-存在空",
                    "10002": "4137415.0951108932",
                    "10003": "230908112750009",
                    "20001": "销售额-存在空",
                    "230908112750009": "4137415.0951108932",
                    "230908112750023": "中南"
                }
            ],
            "fields": {
                "10001": {
                    "alias": "指标名称 "
                },
                "10002": {
                    "alias": "指标值 "
                },
                "20001": {
                    "alias": "图例项 ",
                    "domain": [
                        "销售额-存在空"
                    ],
                    "sortIndex": 0
                },
                "230908112750009": {
                    "alias": "销售额-存在空"
                },
                "230908112750023": {
                    "alias": "地区",
                    "domain": [
                        "地区-dongbei",
                        "华北",
                        "华东",
                        "西北",
                        "西南",
                        "中南"
                    ],
                    "sortIndex": 0
                }
            }
        }
    ],
    "axes": [
        {
            "orient": "radius",
            "zero": true,
            "nice": true,
            "tick": {
                "visible": false,
                "style": {
                    "stroke": "#DADCDD"
                }
            },
            "domainLine": {
                "visible": false
            },
            "grid": {
                "visible": true,
                "style": {
                    "lineWidth": 1,
                    "stroke": "#DADCDD"
                },
                "smooth": false
            },
            "label": {
                "visible": false
            }
        },
        {
            "orient": "angle",
            "tick": {
                "visible": false,
                "style": {
                    "stroke": "#DADCDD"
                }
            },
            "domainLine": {
                "visible": false
            },
            "grid": {
                "visible": true,
                "style": {
                    "stroke": "#DADCDD",
                    "lineWidth": 1,
                    "lineDash": []
                },
                "smooth": false
            },
            "label": {
                "visible": true,
                "space": 4,
                "flush": true,
                "padding": 0,
                "style": {
                    "fontSize": 12,
                    "maxLineWidth": 174,
                    "fill": "#9ca0b1",
                    "angle": 0,
                    "fontWeight": "normal",
                    "dy": -1
                },
                "autoHide": true,
                "autoHideMethod": "greedy"
            }
        }
    ],
    "color": {
        "field": "20001",
        "type": "ordinal",
        "range": [
            "#2E62F1"
        ],
        "specified": {},
        "domain": [
            "销售额-存在空"
        ]
    },
    "label": {
        "visible": true,
        "overlap": {
            "hideOnHit": true
        },
        "style": {
            "fontSize": 12,
            "fill": "#363839",
            "stroke": "rgba(255, 255, 255, 0.8)",
            "strokeOpacity": 1,
            "lineWidth": 2
        }
    },
    "legends": [
        {
            "type": "discrete",
            "id": "legend",
            "orient": "right",
            "position": "start",
            "layoutType": "normal",
            "visible": true,
            "maxCol": 2,
            "title": {
                "textStyle": {
                    "fontSize": 12,
                    "fill": "#6F6F6F"
                }
            },
            "layoutLevel": 60,
            "item": {
                "focus": true,
                "focusIconStyle": {
                    "size": 14
                },
                "maxWidth": 677,
                "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
            }
        }
    ],
    "tooltip": {
        "handler": {}
    },
    "background": "rgba(255, 255, 255, 0)",
    "point": {
        "style": {
            "shape": {
                "type": "ordinal",
                "field": "20001",
                "range": [
                    "circle"
                ],
                "domain": [
                    "销售额-存在空"
                ]
            },
            "size": {
                "type": "ordinal",
                "field": "20001",
                "range": [
                    14.179630807244127
                ],
                "domain": [
                    "销售额-存在空"
                ]
            },
            "fill": {
                "field": "20001",
                "type": "ordinal",
                "range": [
                    "#2E62F1"
                ],
                "specified": {},
                "domain": [
                    "销售额-存在空"
                ]
            },
            "stroke": {
                "field": "20001",
                "type": "ordinal",
                "range": [
                    "#2E62F1"
                ],
                "specified": {},
                "domain": [
                    "销售额-存在空"
                ]
            },
            "strokeOpacity": {
                "type": "ordinal",
                "field": "20001",
                "range": [
                    1
                ],
                "domain": [
                    "销售额-存在空"
                ]
            },
            "fillOpacity": {
                "type": "ordinal",
                "field": "20001",
                "range": [
                    1
                ],
                "domain": [
                    "销售额-存在空"
                ]
            }
        },
        "state": {
            "hover": {
                "lineWidth": 2,
                "fillOpacity": 1,
                "strokeOpacity": 1,
                "scaleX": 1.5,
                "scaleY": 1.5
            }
        }
    },
    "seriesMark": "point",
    "line": {
        "style": {
            "curveType": {
                "type": "ordinal",
                "field": "20001",
                "range": [
                    "linearClosed"
                ],
                "domain": [
                    "销售额-存在空"
                ]
            },
            "lineWidth": {
                "type": "ordinal",
                "field": "20001",
                "range": [
                    1
                ],
                "domain": [
                    "销售额-存在空"
                ]
            },
            "lineDash": {
                "type": "ordinal",
                "field": "20001",
                "range": [
                    [
                        4,
                        2
                    ]
                ],
                "domain": [
                    "销售额-存在空"
                ]
            }
        }
    },
    "area": {
        "visible": true,
        "style": {
            "fillOpacity": 0.35,
            "curveType": {
                "type": "ordinal",
                "field": "20001",
                "range": [
                    "linearClosed"
                ],
                "domain": [
                    "销售额-存在空"
                ]
            }
        }
    },
    "invalidType": "link",
    "animation": false,
    "hash": "068faba417a6f433fc9492463df51677"
}

const vchart = new VChart(spec, { dom: document.getElementById('chart') as HTMLElement });
vchart.renderAsync();

window['vchart'] = vchart;

@youngwinds youngwinds added bug Something isn't working bp labels Sep 8, 2023
@kkxxkk2019 kkxxkk2019 self-assigned this Sep 13, 2023
@kkxxkk2019 kkxxkk2019 added this to the v1.4.0 milestone Sep 13, 2023
@kkxxkk2019 kkxxkk2019 mentioned this issue Sep 13, 2023
20 tasks
@kkxxkk2019
Copy link
Collaborator

这个会在 1.4.0 版本修复,然后后面就不要使用 linearClosed 了,统一使用 linear 吧。是否闭合会在内部默认处理。

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