Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart2D for Java
 PolarChart and SegmentAttributeMode
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

OLI

6 Posts

Posted - 28 Oct 2011 :  06:00:07  Show Profile  Reply with Quote
The forum works again! =)

When the forum was down we emailed a question about getting PolarChart and SegmentAttributeMode to work. In the reply QC stated that this was a but and that it was fixed in the attached new jar:s. (Thanks for quick reply and new version!)

Now the problem is that I still can't get it to work.

Some extracts from my code:

I define the different Attributes I want to use:


	private ChartAttribute[] colors = new ChartAttribute[]{
			new ChartAttribute (Color.BLACK, 1,ChartConstants.LS_SOLID,Color.BLACK),
			new ChartAttribute (Color.DARK_GRAY, 1,ChartConstants.LS_SOLID, Color.DARK_GRAY),
			new ChartAttribute (Color.LIGHT_GRAY, 1,ChartConstants.LS_SOLID, Color.LIGHT_GRAY),
			new ChartAttribute (Color.BLACK, 1,ChartConstants.LS_SOLID, Color.BLACK)
	};


Plot definition:

	private PolarScatterPlot scatterPlot;
	// .......
	......//
	scatterPlot = new PolarScatterPlot(transform, allVectors,
				   ChartConstants.CIRCLE, colors[0]);


I use the following method to update the graph after I have set new data on update:


	private void reloadColors(){
		scatterPlot.setSegmentAttributesMode(true);
		int i = 0;
		for(ChartAttribute color:colors){
			color.setFillFlag(true);
			color.setLineFlag(true);
			color.setFillColor(color.getColor());
			color.setLineColor(color.getColor());
			scatterPlot.setSegmentAttributes(i, color);
			i++;
		}
		colors[colors.length-1].setFillFlag(false);
		colors[colors.length-1].setLineFlag(true);
	}


The only thing I run after that method when updating data is updateDraw().

So any obvious errors with this method?
If you need any more info don't hesitate to ask.

quinncurtis

1531 Posts

Posted - 28 Oct 2011 :  10:51:12  Show Profile  Reply with Quote
We tested the software and it works for us. Make this modification to the thePlot2 plot in the PolarPlots.PolarLine example program:

ChartAttribute attrib2 = new ChartAttribute (Color.red, 1,0,Color.red);
attrib2.setFillFlag(true);
PolarScatterPlot thePlot2 = new PolarScatterPlot(pPolarTransform, Dataset1,ChartConstants.CIRCLE,attrib2);
thePlot2.setSegmentAttributesMode(true);
ChartAttribute segmentAttrib = new ChartAttribute (Color.yellow, 1,ChartConstants.LS_SOLID, Color.yellow);
segmentAttrib.setSymbolSize(20);
thePlot2.setSegmentAttributes(8,segmentAttrib);
thePlot2.setSegmentAttributes(9,segmentAttrib);
thePlot2.setSegmentAttributes(10,segmentAttrib);
thePlot2.setSegmentAttributes(11,segmentAttrib);

gWG.addChartObject(thePlot2);

Let us know the results. If it doesn't you need to check the reference to the qcchart2djava.jar file and make sure it is the one we sent you.

Go to Top of Page

OLI

6 Posts

Posted - 28 Oct 2011 :  15:37:52  Show Profile  Reply with Quote
Found the problem I had installed the wrong .jar file thanks for the help!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07