Added functionality to clear the chart canvas so charts can be more easily created
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user