Skip to content

Commit

Permalink
Add default value for legend modifier, implement experimental fix for #…
Browse files Browse the repository at this point in the history
  • Loading branch information
phibr0 committed Mar 24, 2022
1 parent a549630 commit 633d386
Show file tree
Hide file tree
Showing 3 changed files with 590 additions and 594 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-charts",
"name": "Obsidian Charts",
"version": "3.4.5",
"version": "3.4.6",
"minAppVersion": "0.12.7",
"description": "This Plugin lets you create Charts within Obsidian",
"author": "phibr0",
Expand Down
7 changes: 4 additions & 3 deletions src/chartRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class Renderer {
...Chart.defaults.plugins,
legend: {
...Chart.defaults.plugins.legend,
display: yaml.legend,
display: yaml.legend ?? true,
position: yaml.legendPosition ?? "top",
},
};
Expand Down Expand Up @@ -295,10 +295,11 @@ class ChartRenderChild extends MarkdownRenderChild {
}

onunload() {
this.renderer.plugin.app.metadataCache.off("changed", this.changeHandler);
this.renderer.plugin.app.workspace.off('css-change', this.reload);
this.el.style.height = this.el.querySelector('canvas').clientHeight + 'px';
this.el.empty();
this.chart && this.chart.destroy();
this.chart = null;
this.renderer.plugin.app.metadataCache.off("changed", this.changeHandler);
this.renderer.plugin.app.workspace.off('css-change', this.reload);
}
}
Loading

0 comments on commit 633d386

Please sign in to comment.