Skip to content

Commit 46de30b

Browse files
authored
Merge pull request #81 from simelis/patch-1
Fix formatter after updateOptions
2 parents c0aeddb + eaf4158 commit 46de30b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Blazor-ApexCharts/wwwroot/js/blazor-apex-charts.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@
4949
},
5050

5151
updateOptions(id, options, redrawPaths, animate, updateSyncedCharts) {
52-
var data = JSON.parse(options);
52+
var data = JSON.parse(options, (key, value) =>
53+
(key === 'formatter' || key === 'custom') && value.length !== 0 ? eval("(" + value + ")") : value
54+
);
5355
var chart = this.findChart(id);
5456
if (chart !== undefined) {
5557
this.LogMethodCall(chart, "updateOptions", options);
@@ -236,4 +238,4 @@
236238
console.log('Chart ' + options.chart.id + ' rendered');
237239
}
238240
}
239-
}
241+
}

0 commit comments

Comments
 (0)