init forgetting curve

This commit is contained in:
Julien Calixte
2022-11-19 17:01:03 +01:00
parent 7117a67d66
commit 91e98c88e8
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<script setup lang="ts">
import chart from 'chart.xkcd'
import { onMounted } from 'vue';
onMounted(() => {
const svg = document.querySelector('.forgetting-curve')
new chart.Line(svg, {
title: 'The forgetting curve',
xLabel: '# days',
yLabel: 'Retention',
data: {
labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
datasets: [{
label: 'Reality',
data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
}],
}
})
})
</script>
<template>
<svg class="forgetting-curve"></svg>
</template>
<style scoped>
svg {
min-height: 300px;
width: 500px;
margin: auto;
}
</style>