Why does one chart overlays another (chart.js)?

I wanted to create one chart and update type. But when I update pie chart type to bar both charts are visible

function rebuildExpensesChart(){
    let ct = document.getElementById("chartType").value

    ExpensesChartConfig.data.datasets = [{
        type: ct,
        //some code here...
    }]
    ExpensesChartConfig.data.labels = someLabels
    ExpensesChart.update()
    console.log(ExpensesChart)
}

How it looks

How it should look