// add your additional code here private async void AddData(object? state) {
await InvokeAsync(() =>
{
if (_data.Count >= 60)
{
_data.RemoveAt(0);
}
_data.Add(new ChartData() { TimeStamp = DateTime.UtcNow, Y = _random.NextDouble() });
base.StateHasChanged();
}); } |
// add your additional code here
<ChartPrimaryXAxis Visible="false" ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime" IntervalType="IntervalType.Seconds">
</ChartPrimaryXAxis> <ChartAxes> <ChartAxis EdgeLabelPlacement="Syncfusion.Blazor.Charts.EdgeLabelPlacement.Shift" Minimum="0" Maximum="60" Interval="60" IsInversed="true" RowIndex="0" Name="xAxis" LabelFormat="{value}Seconds">
<ChartAxisLineStyle Width="0"></ChartAxisLineStyle>
<ChartAxisMajorGridLines Width="0"></ChartAxisMajorGridLines>
</ChartAxis> </ChartAxes> |
This private feedback is not associated with your account.
If you believe that this error message is incorrect, please feel free to contact us
<SfButton @ref="button" Content="Start" @onclick="@onChange"></SfButton>
<SfChart Height="150px" @ref="Chart1">
// add your additional code here </SfChart>
// add your additional code here @code { public SfButton button;
public SfChart Chart1; public SfChart Chart2; public SfChart Chart3; public SfChart Chart4; public SfChart Chart5; public SfChart Chart6; public SfChart Chart7; public SfChart Chart8; public SfChart Chart9; public SfChart Chart10; public SfChart Chart11; public SfChart Chart12; int counter = 1; // add your additional code here void OnTimedEvent(Object source, ElapsedEventArgs e)
{ count++; this.DataSource.RemoveAt(0); this.DataSource.Add(new ChartData { XValue = count, YValue = 30, YValue1 = 35, Low = 20, High = 40 }); this.Chart1.RefreshLiveData(); this.Chart2.RefreshLiveData(); this.Chart3.RefreshLiveData(); this.Chart4.RefreshLiveData(); this.Chart5.RefreshLiveData(); this.Chart6.RefreshLiveData(); this.Chart7.RefreshLiveData(); this.Chart8.RefreshLiveData(); this.Chart9.RefreshLiveData(); this.Chart10.RefreshLiveData(); this.Chart11.RefreshLiveData(); this.Chart12.RefreshLiveData(); //InvokeAsync(StateHasChanged); }
} |