mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix charts
This commit is contained in:
1 parent
b6d04b4115
commit
dadbd17d36
3 files changed
+93
-145
No files matched your search
@@ -1,44 +1,6 @@
|
||||
<script lang="ts">
|
||||
import 'chart.js/auto';
|
||||
import { Chart, type ChartDataset } from 'chart.js';
|
||||
import { onMount } from 'svelte';
|
||||
let element: HTMLCanvasElement;
|
||||
|
||||
export let labels: string[];
|
||||
export let datasets: ChartDataset<'line'>[];
|
||||
|
||||
onMount(() => {
|
||||
new Chart(element, {
|
||||
type: 'line',
|
||||
data: {
|
||||
datasets,
|
||||
labels
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
x: {
|
||||
display: false
|
||||
},
|
||||
y: {
|
||||
min: 0
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
mode: 'index',
|
||||
intersect: false,
|
||||
caretPadding: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
export let datasets: any[];
|
||||
</script>
|
||||
|
||||
<canvas bind:this={element} />
|
||||
|
||||
<style>
|
||||
canvas {
|
||||
max-height: 12rem;
|
||||
}
|
||||
</style>
|
||||
<canvas />
|
||||
Reference in new issue
Block a user