apexcharts / Blazor-ApexCharts

A blazor wrapper for ApexCharts.js
https://apexcharts.github.io/Blazor-ApexCharts
MIT License
784 stars 91 forks source link

How can I remove a point from the graph? #425

Closed Boobert21 closed 5 months ago

Boobert21 commented 6 months ago

Hi all! I apologize if this topic already exists :) I'm adding points on using

`timeSeries.AddRange(newData);

await chart.AppendDataAsync(newData);`

, but is there a way to remove a point from the graph dynamically? For example, when adding a point, I put an object in the list that describes the point. But if I delete, for example, the first object from the list, and use the previous methods, then the point will not disappear on the graph, although it is not in the list. I also tried to create a ready-made copy of the list and pass exactly the copy to the method, but this did not help. If anyone knows the answer, please tell me! Thank you very much in advance!

joadan commented 6 months ago

Hi,

I'm afraid there is no explicit method to remove data, but you should be able to use UpdateSeriesAsync method to provide a new set of data.

Sample here, https://apexcharts.github.io/Blazor-ApexCharts/methods/update-series