Skip to content

Commit

Permalink
fix convertTicksToLabels undefined error for RadarChart
Browse files Browse the repository at this point in the history
  • Loading branch information
ipax77 committed Dec 18, 2020
1 parent f669c0c commit 61d9f7e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ChartJs.Blazor/Interop/TypeScript/ChartJsInterop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ class ChartJsInterop {

if (config.options?.scale?.ticks) {
config.options.scale.ticks.callback = this.getMethodHandler(<IMethodHandler>config.options.scale.ticks.callback, undefined);
if (!config.options.scale.ticks.callback) {
delete config.options.scale.ticks.callback; // undefined != deleted, Chart.js throws an error if it's undefined so we have to delete it
}
}
}

Expand Down

0 comments on commit 61d9f7e

Please sign in to comment.