add search to range index

This commit is contained in:
2022-12-03 21:27:39 -05:00
parent 3ea4b77b67
commit 45da547f62
20 changed files with 342 additions and 110 deletions

View File

@ -80,6 +80,27 @@ export default {
}
})
},
updateChart (el) {
const data = JSON.parse(el.dataset.chartData)
this.el.chart.data = {
datasets: [{
label: el.dataset.label,
data: data.map(({ date, count, label }) => ({
label,
x: date,
y: count
})),
backgroundColor: `${el.dataset.color}77`,
borderColor: el.dataset.color,
fill: true,
borderWidth: 3,
pointBorderWidth: 1
}]
}
this.el.chart.update()
},
mounted () { this.initalizeChart(this.el) },
updated () { this.initalizeChart(this.el) }
updated () { this.updateChart(this.el) }
}