chart export fix

This commit is contained in:
Jan Prochazka
2022-01-02 20:38:57 +01:00
parent 61aa257992
commit 1e2ca1e297

View File

@@ -22,6 +22,7 @@
<script lang="ts"> <script lang="ts">
import { onMount, afterUpdate, onDestroy } from 'svelte'; import { onMount, afterUpdate, onDestroy } from 'svelte';
import _ from 'lodash';
import registerCommand from '../commands/registerCommand'; import registerCommand from '../commands/registerCommand';
import { apiCall } from '../utility/api'; import { apiCall } from '../utility/api';
@@ -44,8 +45,8 @@
onMount(() => { onMount(() => {
chart = new Chart(domChart, { chart = new Chart(domChart, {
type, type,
data, data: data,
options, options: _.cloneDeep(options),
}); });
}); });
@@ -53,7 +54,7 @@
if (!chart) return; if (!chart) return;
chart.data = data; chart.data = data;
chart.type = type; chart.type = type;
chart.options = options; chart.options = _.cloneDeep(options);
// chart.plugins = plugins; // chart.plugins = plugins;
chart.update(); chart.update();
}); });