diff --git a/src/Blazor-ApexCharts/ApexGauge.razor b/src/Blazor-ApexCharts/ApexGauge.razor index f08f1983..adec548f 100644 --- a/src/Blazor-ApexCharts/ApexGauge.razor +++ b/src/Blazor-ApexCharts/ApexGauge.razor @@ -1,6 +1,6 @@ @namespace ApexCharts - + /// Component to create a single-value chart in Blazor - /// - public partial class ApexGauge : IDisposable - { - /// - [Parameter] public string Title { get; set; } - - /// - [Parameter] public decimal Percentage { get; set; } - - /// - [Parameter] public string Label { get; set; } - + /// + public partial class ApexGauge : IDisposable + { + /// + [Parameter] public string Title { get; set; } + + /// + [Parameter] public decimal Percentage { get; set; } + + /// + [Parameter] public string Label { get; set; } + /// /// The options to customize the radial bar chart with - /// - [Parameter] public ApexChartOptions Options { get; set; } = new ApexChartOptions(); - + /// + [Parameter] public ApexChartOptions Options { get; set; } = new ApexChartOptions(); + private ApexChartOptions options; - /// - protected override void OnInitialized() - { - options = Options; - } - - private List GetItems() - { - return new List { new GaugeValue { Label = Label, Percentage = Percentage } }; - } - - /// - public void Dispose() - { - GC.SuppressFinalize(this); - } - } -} + ApexChart GaugeReference; + + /// + protected override void OnInitialized() + { + options = Options; + } + + + /// + /// Allows you to update the series array overriding the existing one. If you want to append series to existing series, use the appendSeries() method + /// + /// Should the chart animate on re-rendering + /// + /// Links: + /// + /// Blazor Example, + /// JavaScript Documentation + /// + public Task UpdateValueAsync(bool animate = true) => + GaugeReference?.UpdateSeriesAsync(animate); + + private List GetItems() + { + return new List { new GaugeValue { Label = Label, Percentage = Percentage } }; + } + + /// + public void Dispose() + { + GC.SuppressFinalize(this); + } + } +}