Set color on existing seriesSee original GitHub issue
Someone asked something similar in #182 but it looks like the implementation changed such that the only way is to delete and add the series. I can’t really do this in my application because I’m streaming live data. I was hoping to do something like:
this.graph.series[index].stroke = 'green'
Where of course
this.graph is the reference to uPlot. This results in the error
s.stroke is not a function. It’s a little confusing to me because previously I was saving and restoring colors to my color list for use in future graph items.
- Created a year ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
just keep the data externally in
this.data and re-provide it when re-initializing the plot, right?
I appreciate the help. Wouldn’t
u.destroy() remove the series and the stored data? I mean you could do this at initialization like you said but you’d lose anything currently on the plot correct? Or is there another way to rebuilt the plot while keeping the data and just redrawing / layout?