almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.86k stars 1.48k forks source link

Is it possible to have a single line be drawn with multiple colors based on the data? #4295

Open nsarka opened 5 years ago

nsarka commented 5 years ago

I'm using the example from here: http://visjs.org/examples/graph2d/15_streaming_data.html

What I was wondering is if that blue line in some areas can be shaded red or green depending on an extra field added to the data.

For example, { x: now, y: bytes_transferred color: algorithm_currently_being_used() } where algorithm_currently_being_used() returns some color to distinguish which algorithm is in use.

I've already tried creating groups for each algorithm and then styling the group with a color, but vis will treat each group as a separate line instead of one line that just changes color.