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