Subject: XYGraph - how to draw data points with no connecting line? |
Author: Patrik Suzzi |
Date: Wed, 16 September 2015 19:43 |
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.
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 3 times) |
|
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]
|