Thank you. We already do that when the graph is rendered. But we want the count to be updated live based on the number of visible points on the graph, when the filter is applied. We have a user interaction in place that updates the date filter and it would be useful for the users to see how many data points match the date range they’ve selected.
Therefore, we need to rename the labels after the plot has been rendered using the new count. Is that possible?
Your example seems to point in the right direction, but is there some kind of variable interpolation or callback we could use to show the number of points as part of the legend label?