Update chartglwidget's update_plot method
When I tried reducing the number of traces, the old traces continued to appear in the plot. To address this issue, I implemented a small piece of code that removes the old traces whenever the number of new data points is fewer than the existing number of traces.