Skip to content

[bug] yoyo has wrong value #677

Open
@alphabetabc

Description

@alphabetabc

demo

const rootEl = document.getElementById("root");
Object.assign(rootEl.style, {
    width: "800px",
    height: "600px",
});

rootEl.innerHTML = "loading";

const dataX = [];
const dataY = [];

let i = 0;
createAnimationQueue({
    from: { value: 1 },
    to: { value: 1.5 },
    yoyo: true,
    repeat: 3,
    onUpdate: (o) => {
        dataX.push(i++);
        dataY.push(o.value);
    },
    onComplete: () => {
        const chart = ec.init(rootEl);
        chart.setOption({
            xAxis: {
                type: "category",
                data: dataX,
            },
            yAxis: {
                type: "value",
            },
            series: [
                {
                    data: dataY,
                    type: "line",
                },
            ],
        });
    },
});

result

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions