Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCRTGraph for Java
 MeterAxisLabels not showing

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
jimmclaughlin Posted - 19 Aug 2005 : 11:54:12
Hi,
I've been trying out this library and so far I really dig it. I am having one problem, however. I have some RTMeters that are pretty much a cut and paste of the Humidity meter from the weather station example (com.quinncurtis.rtgraphjava.examples.weatherstation). It works great if the startarcscale and endarcscale are separated by a margin of at least 4.0, but less than that, the labels other than the first don't show. These are the startscale and endscales I am trying to show:

0.00 to 0.50
23.0 to 26.0
25.0 to 28.0
26.0 to 29.0
59.5 to 60.5

I would really appreciate some advice on how to scale the ticks for the labels to show properly
1   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 19 Aug 2005 : 16:41:59
You are probably not setting the MeterAxis.setAxisTickSpace and MeterAxis.setAxisMinorTicksPerMajor properties correctly to reflect the range that you want. The following method that creates a meter with a range of 23 to 26, works fine.
Note the lines:

meteraxis.setAxisTickSpace(0.2);
meteraxis.setAxisMinorTicksPerMajor(5);

that place a minor tick mark every 0.2 units, and a major tick mark every (0.2 * 5) = 1.0 units.


		
private void InitializeMeterIndicator2()
{
	ChartView chartVu  = this;
	ChartAttribute attrib1 = new ChartAttribute (Color.black, 1,ChartConstants.LS_SOLID, Color.blue);

	double startarcangle = 220;
	double arcextent = 260;
	double startarcscale = 23.0;
	double endarcscale = 26.0;
	boolean arcdirection = false;
	double arcradius = 0.60;
	double centerx = 0.0, centery= -0.0;
	Font meterFont = font24;

	RTMeterCoordinates meterframe = new RTMeterCoordinates(startarcangle, arcextent,
	startarcscale, endarcscale, arcdirection, centerx, centery, arcradius);

	meterframe.setGraphBorderDiagonal(0.0, 0.0, 1.0, 1.0) ;
	Background background = new Background( meterframe, ChartObj.PLOT_BACKGROUND, Color.white);			
	chartVu.addChartObject(background);

	RTMeterNeedleIndicator meterneedle = new RTMeterNeedleIndicator(meterframe, meterProcessVar1);
	meterneedle.setChartObjAttributes(attrib1);
	meterneedle.setNeedleLength ( 0.6);


	chartVu.addChartObject(meterneedle);

	RTMeterAxis meteraxis = new RTMeterAxis(meterframe, meterneedle);
	meteraxis.setChartObjAttributes(attrib1);
		
	meteraxis.setAxisTickDir(ChartObj.AXIS_MIN);
	meteraxis.setLineWidth(3);
	meteraxis.setLineColor( Color.black);
	meteraxis.setAxisTickSpace(0.2);
	meteraxis.setAxisMinorTicksPerMajor(5);
	meteraxis.setAxisMajorTickLength(20);
	meterneedle.setMeterAxis(meteraxis);
	chartVu.addChartObject(meteraxis);

	RTMeterAxisLabels meteraxislabels = new RTMeterAxisLabels(meteraxis);
	meteraxislabels.setTextFont(meterFont);
	meteraxislabels.setAxisLabelsDir(meteraxis.getAxisTickDir());
	meteraxislabels.setOverlapLabelMode( ChartObj.OVERLAP_LABEL_DRAW);
	chartVu.addChartObject(meteraxislabels);
}

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07