question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set color on existing series

See 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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
leeoniyacommented, Oct 7, 2022

just keep the data externally in this.data and re-provide it when re-initializing the plot, right?

0reactions
jmthomascommented, Oct 7, 2022

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vary the colors of same-series data markers in a chart
Set varying colors of data markers (bars, columns, lines, pie or doughnut slices, dots, and other shapes) automatically in an Office chart.
Read more >
How to plot a pd.Series and use the color for each point ...
I have a pd.Series called data that I would like to plot, and I have another series with the same index as data...
Read more >
Apply colors to data points or series using color rules
Auto Color Rules automatically come up with a series of colors applied based on measure values. You can change their settings to determine...
Read more >
MATLAB colororder - MathWorks
The color order controls the set of colors that MATLAB uses for plotting multiple data series within an axes. Graphics objects such as...
Read more >
Set Pandas dataframe background Color and font color in ...
We can modify DataFrame using a user-defined function: With the help of this function, we can customizing the font color of positive data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found