31 lines
781 B
C#
31 lines
781 B
C#
using Microsoft.JSInterop;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SZUAbsolventenverein.Module.EventRegistration
|
|
{
|
|
public class Interop
|
|
{
|
|
private readonly IJSRuntime _jsRuntime;
|
|
|
|
public Interop(IJSRuntime jsRuntime)
|
|
{
|
|
_jsRuntime = jsRuntime;
|
|
}
|
|
|
|
public async Task CreateChart(string divid, string type, string[] labels, object[] datasets, object options)
|
|
{
|
|
try
|
|
{
|
|
await _jsRuntime.InvokeVoidAsync(
|
|
"SZUAbsolventenverein.EventRegistration.createChart",
|
|
divid, type, (object) labels, (object) datasets, options);
|
|
}
|
|
catch
|
|
{
|
|
// handle exception
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|