Skip to content

Commit

Permalink
fix(legacy-charts): tune chartoptions type check
Browse files Browse the repository at this point in the history
  • Loading branch information
thabarbados committed Apr 25, 2022
1 parent f2a33aa commit 22a5f4a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions legacy/src/Charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,10 @@ export function generateChart(chartId, chartType, chartController) {
},
computed: {
hasAnnotationPlugin() {
return (
Object.keys(this.chartOptions).length > 0 &&
'plugins' in this.chartOptions &&
Object.keys(this.chartOptions.plugins).length > 0 &&
ANNOTATION_PLUGIN_KEY in this.chartOptions.plugins
)
const pluginSettings =
this.chartOptions?.plugins?.[ANNOTATION_PLUGIN_KEY]

return typeof pluginSettings !== 'undefined'
}
},
created() {
Expand Down

0 comments on commit 22a5f4a

Please sign in to comment.