antvis/G2

[v5] clear and re-render chart throw error: Mismatched interpolation arguments 0:undefined #4671

coader posted onGitHub

image

and I tried it in example page, also has error but like this: image


so I need new Chart() again?

posted by coader about 2 years ago

You don't have to new Chart again theoretically. It looks like that chart.clear() doesn't work as expected. This will be fixed in this week.

Right now you use new Chart for temporary solutions.

posted by pearmini about 2 years ago

now I use:

if (chart)
        chart.clear()
    chart = new Chart({
        container: container.value,
        autoFit: true,
    })

and it works

posted by coader about 2 years ago

now I use:

if (chart)
        chart.clear()
    chart = new Chart({
        container: container.value,
        autoFit: true,
    })

and it works

That sounds good! But I think there are still some problems with chart.clear.

// Error!!!
chart.render(() => {
  chart.clear();
})
posted by pearmini about 2 years ago

now I use:

if (chart)
        chart.clear()
    chart = new Chart({
        container: container.value,
        autoFit: true,
    })

and it works

That sounds good! But I think there are still some problems with chart.clear.

// Error!!!
chart.render(() => {
  chart.clear();
})

This bug has fixed.

posted by pepper-nice about 2 years ago

Fund this Issue

$0.00
Funded

Pull requests