Skip to content

Commit 3b5dac6

Browse files
committed
fixes in chart
1 parent 8ae3f40 commit 3b5dac6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/chart/ChartJsWebcomponent.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export class ChartJsWebcomponent extends BaseCustomWebComponentConstructorAppend
3232
borderColor: String,
3333
backgroundColor: String,
3434
enableXScale: Boolean,
35-
enableYScale: Boolean
35+
enableYScale: Boolean,
36+
type: String
3637
}
3738

3839
#data: Data[]
@@ -90,7 +91,7 @@ export class ChartJsWebcomponent extends BaseCustomWebComponentConstructorAppend
9091
}
9192
}
9293

93-
#type: 'line' | 'bar';
94+
#type: 'line' | 'bar' = 'line';
9495
public get type() {
9596
return this.#type;
9697
}
@@ -149,6 +150,7 @@ export class ChartJsWebcomponent extends BaseCustomWebComponentConstructorAppend
149150
this.#chart.data.datasets[0].backgroundColor = this.#backgroundColor;
150151
this.#chart.options.scales.x.display = this.#enableXScale;
151152
this.#chart.options.scales.y.display = this.#enableYScale;
153+
this.#chart.update();
152154
} else {
153155
this.#chart = new Chart(
154156
this.#root,

0 commit comments

Comments
 (0)