Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11:49 Go to next message
Elip Dkc is currently offline Elip DkcFriend
Messages: 2
Registered: May 2018
Junior Member
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 10:10 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

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 13:59 Go to previous messageGo to next message
Elip Dkc is currently offline Elip DkcFriend
Messages: 2
Registered: May 2018
Junior Member
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 07:09]

Report message to a moderator

Re: XY Graph - Single series with different color [message #1786620 is a reply to message #1786536] Tue, 08 May 2018 14:52 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

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 14:53]

Report message to a 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: Thu Apr 25 00:09:38 GMT 2024

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

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

Back to the top