Added functionality to clear the chart canvas so charts can be more easily created

This commit is contained in:
2025-06-29 02:00:40 -04:00
parent fec91b1c1c
commit 3f5f374a36

View File

@ -1,4 +1,6 @@
$ ->
chartInstance = null
$('#reports-download').on 'click', ->
canvas = $('#benchmark-chart')[0]
a = document.createElement 'a'
@ -7,6 +9,8 @@ $ ->
a.click()
$('#reports-button').on 'click', (e) ->
chartInstance.destroy() if chartInstance
benchmarkId = $('#report-benchmarks').val()
testIds = $('#report-tests').val()
@ -67,7 +71,7 @@ $ ->
y:
beginAtZero: true
new Chart ctx,
chartInstance = new Chart ctx,
type: 'bar'
data: data
options: options