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] updateDataSync produces inconsistent results compared to direct drawing. #2503

Closed
xiaoluoHe opened this issue Mar 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@xiaoluoHe
Copy link
Contributor

xiaoluoHe commented Mar 29, 2024

Version

1.10.2

Link to Minimal Reproduction

none

Steps to Reproduce

const values = [
    {
        "x": "0",
        "type": "A",
        "y": 100
    },
    {
        "x": "1",
        "type": "A",
        "y": "707"
    },
    {
        "x": "2",
        "type": "A",
        "y": "832"
    },
    {
        "x": "3",
        "type": "A",
        "y": "726"
    },
    {
        "x": "4",
        "type": "A",
        "y": "756"
    },
    {
        "x": "5",
        "type": "A",
        "y": "777"
    },
    {
        "x": "6",
        "type": "A",
        "y": "689"
    },
    {
        "x": "7",
        "type": "A",
        "y": "795"
    },
    {
        "x": "8",
        "type": "A",
        "y": "889"
    },
    {
        "x": "9",
        "type": "A",
        "y": "757"
    },
    {
        "x": "0",
        "type": "B",
        "y": "773"
    },
    {
        "x": "1",
        "type": "B",
        "y": "785"
    },
    {
        "x": "2",
        "type": "B",
        "y": "635"
    },
    {
        "x": "3",
        "type": "B",
        "y": "813"
    },
    {
        "x": "4",
        "type": "B",
        "y": "678"
    },
    {
        "x": "5",
        "type": "B",
        "y": 896
    },
    {
        "x": "6",
        "type": "B",
        "y": "652"
    },
    {
        "x": "7",
        "type": "B",
        "y": "623"
    },
    {
        "x": "8",
        "type": "B",
        "y": "649"
    },
    {
        "x": "9",
        "type": "B",
        "y": "630"
    }
];

const spec = {
    "type": "pie",
    "data": [
        {
            "id": "data",
        }
    ],
     valueField: "y",
        categoryField: "type",
        seriesField:'type',
        title: {
          visible: true,
          text: "Statistics of Surface Element Content",
        },
        legends: [
          {
          visible: true,
          orient: "left",
        }
        ],
        label: {
          visible: true,
        },
        tooltip: {
          visible: false,
        }
}

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

vchart.updateDataSync('data', values);

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

Current Behavior

正常绘制结果:
image

通过 updateDataSync 更新数据绘制结果:
image

Expected Behavior

两种使用方式的绘制结果一致

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@xiaoluoHe xiaoluoHe added the bug Something isn't working label Mar 29, 2024
@zamhown zamhown mentioned this issue Apr 2, 2024
20 tasks
@zamhown zamhown closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants