private async Task HandleRedraw <TDataSet, TItem, TOptions, TModel>(Blazorise.Charts.BaseChart <TDataSet, TItem, TOptions, TModel> chart, Func <TDataSet> getDataSet)
            where TDataSet : ChartDataset <TItem>
            where TOptions : ChartOptions
            where TModel : ChartModel
        {
            await chart.Clear();

            await chart.AddLabelsDatasetsAndUpdate(Labels, getDataSet());
        }
Beispiel #2
0
        protected async Task HandleRedraw <TDataSet, TItem, TOptions, TModel>(Blazorise.Charts.BaseChart <TDataSet, TItem, TOptions, TModel> chart, Func <TDataSet> getDataSet, IEnumerable <string> labels)
            where TDataSet : ChartDataset <TItem>
            where TOptions : ChartOptions
            where TModel : ChartModel
        {
            if (chart != null)
            {
                var dataSet = getDataSet();

                await chart.Clear();

                await chart.AddLabel(labels.ToArray());

                await chart.AddDataSet(dataSet);

                await chart.Update();
            }
        }