Skip to content

Commit

Permalink
fixes in chart
Browse files Browse the repository at this point in the history
  • Loading branch information
jogibear9988 committed Nov 29, 2023
1 parent 8ae3f40 commit 3b5dac6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/chart/ChartJsWebcomponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export class ChartJsWebcomponent extends BaseCustomWebComponentConstructorAppend
borderColor: String,
backgroundColor: String,
enableXScale: Boolean,
enableYScale: Boolean
enableYScale: Boolean,
type: String
}

#data: Data[]
Expand Down Expand Up @@ -90,7 +91,7 @@ export class ChartJsWebcomponent extends BaseCustomWebComponentConstructorAppend
}
}

#type: 'line' | 'bar';
#type: 'line' | 'bar' = 'line';
public get type() {
return this.#type;
}
Expand Down Expand Up @@ -149,6 +150,7 @@ export class ChartJsWebcomponent extends BaseCustomWebComponentConstructorAppend
this.#chart.data.datasets[0].backgroundColor = this.#backgroundColor;
this.#chart.options.scales.x.display = this.#enableXScale;
this.#chart.options.scales.y.display = this.#enableYScale;
this.#chart.update();
} else {
this.#chart = new Chart(
this.#root,
Expand Down

0 comments on commit 3b5dac6

Please sign in to comment.