chart popup menu

This commit is contained in:
Jan Prochazka
2021-03-20 08:35:18 +01:00
parent efc07280a6
commit a1ab47a6f9
6 changed files with 72 additions and 4 deletions

View File

@@ -1,11 +1,13 @@
<script lang="ts">
import { onMount, afterUpdate, onDestroy } from 'svelte';
import Chart from 'chart.js';
import contextMenu from '../utility/contextMenu';
export let data;
export let type = 'line';
export let options = {};
export let plugins = {};
export let menu;
let chart = null;
let domChart;
@@ -31,4 +33,4 @@
});
</script>
<canvas bind:this={domChart} {...$$restProps} />
<canvas bind:this={domChart} {...$$restProps} use:contextMenu={menu} />