Skip to main content



      Home
Home » Eclipse Projects » Nebula » XY Graph - Single series with different color
XY Graph - Single series with different color [message #1786493] Fri, 04 May 2018 07:49 Go to next message
Eclipse UserFriend
I would like to change the color of trace line if it is in an alarm state, i.e., if it is higher or lower than some thd value such that the color should be red or green.

I don't know if it is possible but can you provide your suggestions, examples or some related documentation?

Thanks
Re: XY Graph - Single series with different color [message #1786534 is a reply to message #1786493] Sun, 06 May 2018 06:10 Go to previous messageGo to next message
Eclipse UserFriend
Hey Elip,

That should not be very hard. There are some snippets here [1], the GraphDemo should be a good starting point. Just copy the plain source and paste it into your source folder and run as java application or check out the project from git.

[1] http://git.eclipse.org/c/nebula/org.eclipse.nebula.git/plain/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/visualization/

Cheers,

Wim
Re: XY Graph - Single series with different color [message #1786536 is a reply to message #1786534] Sun, 06 May 2018 09:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi Wim,

Thanks for your response. But i think i didn't explain myself well. I already looked at these examples. They have multiple lines with different colors but i look for a single line with some parts red, some parts green.

It seems like:
http://www.woorimtech.com/img_up/shop_pds/adm1188/design/2014/golden/multiplecolorline.gif

[Updated on: Mon, 07 May 2018 03:09] by Moderator

Re: XY Graph - Single series with different color [message #1786620 is a reply to message #1786536] Tue, 08 May 2018 10:52 Go to previous message
Eclipse UserFriend
You can add a listener to the data provider like so. I don't think you can change the line color of a trace but maybe you can add a figure on that point?

  trace2Provider.addDataProviderListener(provider -> {
			double yValue = provider.getSample(provider.getSize() - 1).getYValue();
			if (yValue < 0) {
				System.out.println("dropped below zero " + yValue);
			} else {
				System.out.println("dropped above zero " + yValue);
			}
		});

[Updated on: Tue, 08 May 2018 10:53] by Moderator

Previous Topic:CSS styling for Nebula Gallery and custom widgets in Eclipse 4.6
Next Topic:upgrade CKeditor in Richtext
Goto Forum:
  


Current Time: Fri May 02 13:25:54 EDT 2025

Powered by FUDForum. Page generated in 0.05545 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top