I have used blazor wrapper for apexchart.js to build a chart Component. this is my ApexChart razor component.
<BLChartContainer>
@if (chartDetails!=null)
{
<ApexChart @ref=_detailsChart TItem="LocationViseStockResponse"
Title="Stocks"
OnDataPointSelection=DataPointsSelected
Debug>
<ApexPointSeries TItem="LocationViseStockResponse"
Items="chartDetails"
Name=""
SeriesType="SeriesType.Bar"
XValue="@(e => e.Location.CodeName)"
YValue="@(e => e.Qty)"
OrderByDescending="e=>e.X" />
</ApexChart>
}
</BLChartContainer>
@code{
private ApexChart<LocationViseStockResponse> _detailsChart;
private SelectedData<LocationViseStockResponse> selectedData;
private IList<LocationViseStockResponse> chartDetails;
protected override async Task OnInitializedAsync()
{
_detailsChart = new();
chartDetails= new List<LocationViseStockResponse>();
//..
}
private void DataPointsSelected(SelectedData<LocationViseStockResponse> selectedData)
{
this.selectedData = selectedData;
_detailsChart?.SetRerenderChart();
}
}
but when I run the application I am getting this console error.
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Could not find 'blazor_apexchart.renderChart' ('blazor_apexchart' was undefined). Error: Could not find 'blazor_apexchart.renderChart' ('blazor_apexchart' was undefined). at https://localhost:5050/_framework/blazor.webassembly.js:1:328 at Array.forEach () at a.findFunction (https://localhost:5050/_framework/blazor.webassembly.js:1:296) at _ (https://localhost:5050/_framework/blazor.webassembly.js:1:2437) at https://localhost:5050/_framework/blazor.webassembly.js:1:3325 at new Promise () at Object.beginInvokeJSFromDotNet (https://localhost:5050/_framework/blazor.webassembly.js:1:3306) at Object.Rt [as invokeJSFromDotNet] (https://localhost:5050/_framework/blazor.webassembly.js:1:59738) at _mono_wasm_invoke_js_blazor (https://localhost:5050/_framework/dotnet.6.0.0.rbisnsgo77.js:1:193780) at wasm://wasm/00945abe:wasm-function[2588]:0x8065b
what is the exact issue??please help me ,appriciate all your helps