Skip to content

[Bug] boxPlot api setDimensionIndex error #4317

@fangsmile

Description

@fangsmile

Version

`

Link to Minimal Reproduction

`

Steps to Reproduce


const spec = {
    "type": "boxPlot",
    "data": {
        "id": "dataId"
    },
    "xField": "Sub-Category",
    "minField": "y1",
    "q1Field": "y2",
    "medianField": "y3",
    "q3Field": "y4",
    "maxField": "y5",
    "outliersField": "y6",
    "direction": "vertical",
    "boxPlot": {
        "style": {
            "shaftShape": "line",
            "lineWidth": 2
        }
    },
    "sortDataByAxis": true,
    "axes": [
        {
            "range": {
                "min": 9.23725,
                "max": 12.655
            },
            "label": {
                "style": {
                    "fontSize": 14
                },
                "visible": false,
                "flush": true
            },
            "domain": [],
            "type": "linear",
            "orient": "left",
            "title": {
                "visible": false
            },
            "domainLine": {
                "visible": false
            },
            "seriesIndex": 0,
            "tick": {
                "visible": false
            },
            "sync": {
                "axisId": "NO_AXISID_FRO_VTABLE"
            }
        },
        {
            "domain": [
                "Televisions"
            ],
            "label": {
                "style": {
                    "fontSize": 14
                },
                "visible": false
            },
            "type": "band",
            "orient": "bottom",
            "visible": true,
            "domainLine": {
                "visible": false
            },
            "tick": {
                "visible": false
            },
            "subTick": {
                "visible": false
            },
            "title": {
                "visible": false
            }
        }
    ],
    "padding": 0,
    "dataZoom": []
};

const vchart = new VChart(spec, { dom: CONTAINER_ID , viewBox: {
          x1: 0,
          x2: 278,
          y1: 0,
          y2: 198
        },});
vchart.renderSync();
vchart.updateDataSync("dataId", [
    {
        "Region": "North",
        "Category": "Electronics",
        "Sub-Category": "Televisions",
        "Country": "China",
        "y1": 9.4,
        "y2": 10.06,
        "y3": 10.75,
        "y4": 11.56,
        "y5": 12.5
    }
]);
vchart.setDimensionIndex("Televisions", {
                tooltip: true,
                showTooltipOption: { x: 100, y: 10, activeType: 'dimension' }
              });
// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;

Current Behavior

`

Expected Behavior

`

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions