Skip to content

Commit

Permalink
fix(legacy-charts): tune chartoptions type check (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
thabarbados committed Apr 25, 2022
1 parent 48df4d7 commit 4409b98
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions legacy/src/Charts.js
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 4409b98

Please sign in to comment.