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
 QCRTGraph for Java
 Numeric Formats
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

daviddu@cctexas.com

14 Posts

Posted - 07 Mar 2006 :  10:25:45  Show Profile  Reply with Quote
As long as I'm posing questions, one more I'm interested in.

Is there a way to display a numeric variable (RTNumericPanelMeter() ) in a fixed width field, with leading zeros or spaces?

David Dudley

quinncurtis

1586 Posts

Posted - 07 Mar 2006 :  12:04:00  Show Profile  Reply with Quote
The software does support fixed width panel meter frames. That can be accomplished using the panelmeter setPanelMeterMinWidth method. You specify the minimum width in device (pixel) units.

The software does not support leading zeros in numeric displays.

Normally the software sets the justification of the panelmeter and the text inside based on the positioning constants, for example ChartObj.OUTSIDE_PLOTAREA_MIN for the RTNumericPanelMeter in the BarApplication1 example program. In that case the panel meter justification is set to JUSTIFY_CENTER for x, and JUSTIFY_MAX for y.

If you are willing to manually position the panel meters, using the ChartConstants.CUSTOM_POSITION positioning constant, you can set the justification to your own values. If you want to right justify the numeric values in the panel meter, you can use similar the following, based on the BarApplication1 example program.

			
RTNumericPanelMeter panelmeter = new RTNumericPanelMeter(pTransform1, panelmeterattrib);
// panelmeter.setPanelMeterPosition( ChartObj.OUTSIDE_PLOTAREA_MIN);

// NO AUTOMATIC POSITIONING
panelmeter.setPanelMeterPosition( ChartConstants.CUSTOM_POSITION);

panelmeter.getNumericTemplate().setTextBgMode ( true);
panelmeter.getNumericTemplate().setLineColor( Color.green);
panelmeter.getNumericTemplate().setTextFont( font24Numeric);
panelmeter.getNumericTemplate().setDecimalPos( 1);
	
// SET WIDTH OF PANEL METER
panelmeter.setPanelMeterMinWidth(100.0);
// SET POSITION OF PANEL METER IN NORM_GRAPH_POS COORDINATES
panelmeter.setLocation(0.75, 0.9, ChartConstants.NORM_GRAPH_POS );
// JUSTIFY PANEL METER WITH RESPECT TO RIGHT
panelmeter.getNumericTemplate().setXJust(ChartConstants.JUSTIFY_MAX);
// JUSTIFY PANEL METER WITH RESPECT TO BOTTOM
panelmeter.getNumericTemplate().setYJust(ChartConstants.JUSTIFY_MIN);


We don't recommend this however, since it is very difficult to position the panel meter properly for variable sized ChartView windows. Also, we have long found that the numeric panel meters, when positioned below a bar, look better centered, not left or right justified.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07