[go: up one dir, main page]

Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » XYGraph - how to draw data points with no connecting line?(Given a Nebula XYGraph trace, how can I display the data points only and not the connecting line?)
XYGraph - how to draw data points with no connecting line? [message #1708457] Wed, 16 September 2015 17:43 Go to next message
Patrik Suzzi is currently offline Patrik SuzziFriend
Messages: 2
Registered: February 2018
Junior Member
Hallo,

I am using Eclipse Nebula XYGraph for a Scientific Project.

In my next graph I will need to display data points only and not the connecting line.

index.php/fa/23287/0/

I tried setting the line width to zero (0), but this is not working.

trace.setLineWidth(0);


Any suggestion ?

        xyGraph = new XYGraph();
        xyGraph.primaryXAxis.setShowMajorGrid(true);
        xyGraph.primaryYAxis.setShowMajorGrid(true);	
        xyGraph.setBackgroundColor(ColorConstants.white);
		
        CircularBufferDataProvider traceDataProvider = new CircularBufferDataProvider(false);
        traceDataProvider.setBufferSize(1000);
        
        for(Node node : resultList){
    		double x = node.getX();
    		double y = node.getX();
    		// add data point
        	traceDataProvider.addSample(new Sample(x, y));
        }
 
        // create the trace
        Trace trace = new Trace("Trace1-XY Plot", xyGraph.primaryXAxis, xyGraph.primaryYAxis, traceDataProvider);
         
        // set trace property
        trace.setPointStyle(PointStyle.XCROSS);
		
        // How to NOT display the connecting line?
        trace.setLineWidth(0);
 
        // add the trace to xyGraph
        xyGraph.addTrace(trace);


Thanks in advance
  • Attachment: scr.png
    (Size: 47.72KB, Downloaded 992 times)
Re: XYGraph - how to draw data points with no connecting line? [message #1708676 is a reply to message #1708457] Fri, 18 September 2015 15:14 Go to previous messageGo to next message
Max Hohenegger is currently offline Max HoheneggerFriend
Messages: 11
Registered: April 2012
Junior Member

This should work:
trace.setTraceType(TraceType.POINT);
Re: XYGraph - how to draw data points with no connecting line? [message #1708833 is a reply to message #1708676] Mon, 21 September 2015 15:40 Go to previous message
Patrik Suzzi is currently offline Patrik SuzziFriend
Messages: 2
Registered: February 2018
Junior Member
Max,

It works. Thank you very much!

Kind Regards
Previous Topic:XYGraph - suggested way for user interaction
Next Topic:Nebula grid GridItem.setForeground(color) not working
Goto Forum:
  


Current Time: Sat Dec 14 05:11:06 GMT 2024

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

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

Back to the top