Is it possible to add new points/series to a line graph by entering the x and y components in a text box and clicking a button to add the points/series to the line graph.
Hi @Lorry,
Yes, this is possible. You can add items to a collection which the Data property of the RadzenLineSeries element is set to. Then call the Reload method of the RadzenChart (you need to get a reference to it). Here is some quick example:
<RadzenChart @ref="myChart">
<RadzenLineSeries Data="myCollection" ValueProperty="Value" CategoryProperty="Category" />
</RadzenChart>
@code {
class MyItem
{
public string Category { get; set; }
public double Value { get; set; }
}
IList<MyItem> myCollection = new List<MyItem>();
RadzenChart myChart;
void AddItem()
{
myCollection.Add(new MyItem { Value = 100, Category = "Category" });
myChart.Reload();
}
}
We can't help unless you tell us more.