Skip to content

Commit f80fe5d

Browse files
committed
fixed error
1 parent a51a5e2 commit f80fe5d

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

src/chartsCreator.ts

-14
This file was deleted.

src/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Plugin, parseYaml } from 'obsidian'
22
import Renderer from 'renderer'
3-
import ChartsCreator from 'chartsCreator';
3+
import EchartsModal from 'modal';
44
import { OptionsType } from './type';
55
import * as echarts from 'echarts'
66

@@ -12,7 +12,7 @@ export default class EchartsPlugin extends Plugin {
1212
id: "echarts-create-charts",
1313
name: "create echarts",
1414
callback: () => {
15-
const creator = new ChartsCreator(this.app)
15+
const creator = new EchartsModal(this.app,"pie")
1616
creator.createPie()
1717
},
1818
});

src/modal.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ export default class EchartsModal extends Modal {
66
chartType: string
77
constructor(app: App, chartType: string) {
88
super(app)
9-
this.chartType = 'pie'
9+
this.chartType = chartType
1010
}
11-
12-
pieModal() {
11+
createPie() {
1312
let option = {
1413
source: '',
1514
}
@@ -33,13 +32,10 @@ export default class EchartsModal extends Modal {
3332
this.close()
3433
})
3534
})
35+
this.open()
3636
}
3737

38-
onOpen() {
39-
if (this.chartType === 'pie') {
40-
this.pieModal()
41-
}
42-
}
38+
4339

4440
onClose() {
4541
let { contentEl } = this

0 commit comments

Comments
 (0)