public async Task Refresh() { foreach (var dataset in ParentChart?.Data?.Datasets ?? Enumerable.Empty <ChartDataset <TItem> >()) { var newData = new ChartStreamingData <TItem>(); await Refreshed.InvokeAsync(newData); await JS.AddData(JSRuntime, ParentChart.ElementId, ParentChart.Data.Datasets.IndexOf(dataset), newData.Value); } }
public async Task Refresh() { if (!Rendered) { return; } foreach (var dataset in ParentChart?.Data?.Datasets ?? Enumerable.Empty <ChartDataset <TItem> >()) { var datasetIndex = ParentChart.Data.Datasets.IndexOf(dataset); var newData = new ChartStreamingData <TItem>(dataset.Label, datasetIndex); await Refreshed.InvokeAsync(newData); await JSModule.AddData(ParentChart.ElementId, newData.DatasetIndex, newData.Value); } }