コード例 #1
0
        async Task AddNewHorizontalBarDataSet()
        {
            var colorIndex = horizontalBarChart.Data.Datasets.Count % backgroundColors.Count;

            await horizontalBarChart.AddDataSet(new BarChartDataset <LiveDataPoint>
            {
                Data            = new List <LiveDataPoint>(),
                Label           = $"Dataset {horizontalBarChart.Data.Datasets.Count + 1}",
                BackgroundColor = backgroundColors[colorIndex],
                BorderColor     = borderColors[colorIndex],
            });

            await horizontalBarChart.Update();
        }