// Copyright © Selmo Technology GmbH. All Rights Reserved

using Microsoft.AspNetCore.Components;
using SelmoStudio.Hmi.Server.SelmoHmi.Charts.Model;
using SelmoStudio.Hmi.Server.TestSetup;

namespace SelmoStudio.Hmi.Server.SelmoHmi.Dashboard.Components
{
    public partial class DashboardLineChartComponent : DashboardComponentBase
    {
        [Parameter]
        public IList<IChartItem> ChartData { get; set; }

        protected override Task OnParametersSetAsync()
        {
            // TODO Get the data source in a proper way using the service
            if (ChartData == null)
            {
                ChartData = TestChartDataProvider.GenerateComplexChartBasedTestData();
            }

            return base.OnParametersSetAsync();
        }
    }
}