예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }