apexcharts / Blazor-ApexCharts

A blazor wrapper for ApexCharts.js
https://apexcharts.github.io/Blazor-ApexCharts
MIT License
749 stars 88 forks source link

[Bug] TooltipHoverFormatter is deserialized as a string, resulting in a "not a function" error when using shared tooltips #449

Closed SparkyTD closed 2 months ago

SparkyTD commented 2 months ago

When specifying a custom tooltip formatter using ApexChartOptions<T>.Legend.TooltipHoverFormatter, the browser throws an exception when the user tries to hover over the area chart, as it tries to call a string like a function.

The problem comes from blazor-apexcharts.js that has custom logic for evaluating function-like string parameters coming from .NET, but it doesn't include TooltipHoverFormatter. I think the solution is as simple as adding || key === 'tooltipHoverFormatter' at the end of that if statement.

joadan commented 2 months ago

I think the solution is as simple as adding || key === 'tooltipHoverFormatter' at the end of that if statement.

Yes, that is correct