remove other content on chart load
This commit is contained in:
parent
7103f96595
commit
e6c32fd8bb
@ -49,13 +49,10 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>Header <a href="../">Back</a></header>
|
||||
<main>
|
||||
<div>
|
||||
<file-drop id="file-drop" accept="application/json"
|
||||
>Drop config here</file-drop
|
||||
>
|
||||
</div>
|
||||
<file-drop id="file-drop" accept="application/json"
|
||||
>Drop config here</file-drop
|
||||
>
|
||||
<div><canvas id="myChart" width="600" height="400"></canvas></div>
|
||||
</main>
|
||||
<script src="./loadChart.js"></script>
|
||||
|
@ -20,4 +20,5 @@ fileDrop.addEventListener('filedrop', e => {
|
||||
readFile(e.files[0])
|
||||
.then(JSON.parse)
|
||||
.then(config => new Chart(ctx, config))
|
||||
.then(document.getElementsByTagName('file-drop')[0].remove())
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user