Meter Component
insert a meter in a worksheet or document
Description
Image of the Components Palette Item
Image of an Inserted Meter
Meter Properties
Meter Component Example
The meter component performs an action or a series of actions to communicate with other embedded components when adjusting the needle in the meter, although assigning an action to a component is not required.
To perform an action when the meter is adjusted, click the meter, and then select Edit Value Changed Code to open the Code Editor dialog for the meter. Enter the commands you want to perform in the Code Editor dialog.
You need to specify one or more embedded components that will display the output when adjusting the needle in the meter. For more information, see the Meter Component Example on this page.
The meter component is customized by setting options in the Meter context panel. To view the settings in the context panel, select the meter component. Actions are associated with components using routines in the DocumentTools package.
The Name property is used to reference the meter gauge when using the routines from the DocumentTools package.
The Show Axis Label and Show Axis Tick Marks properties displays an axis label and axis tick marks on the meter respectively when selected.
The Continuous Update on Drag property performs a continuous action on one or more components when selected. The Maple commands in the Edit Value Changed Code property must be programmed as such to perform this continuous action.
The following table describes the control and use of the meter component options.
An x in the Get column indicates that the option can be read, that is, retrieved by using the DocumentTools[GetProperty] tool.
An x in the Set column indicates that the option can be written, that is, set by using the DocumentTools[SetProperty] tool.
Option
Get
Set
Option Type
continuousupdate
x
true or false
enabled
lower
integer or floating-point number
majorticks
positive integer or positive floating-point number
minorticks
pixelheight
positive integer
pixelwidth
showlabels
showticks
tooltip
string
type
upper
value
visible
Indicates whether the component should update continuously during drag operations. By default, the value is false.
Whether the component is enabled. If enabled, the thumb can be moved with the mouse. By default, the value is false.
The lower bound on the meter. By default, the value is 0.
The interval between the major ticks on the meter. By default, the value is 20.
The interval between the minor ticks on the meter. By default, the value is 10.
The height of the meter image in pixels. By default, the value is 97.
The width of the meter image in pixels. By default, the value is 207.
Indicates if range values are shown. By default, the value is true.
Indicates if tick marks are shown. By default, the value is true.
The text that appears when the user hovers the mouse over the component.
The type of the component. This returns "Meter".
The upper bound on the meter. By default, the value is 100.
The current position of the meter marker. By default, the value is 0.
Specifies if the meter is visible. By default, the value is true .
Note: To interact with the examples provided below, open this help page as a worksheet and then execute the worksheet.
This examples shows how you can change the transparency of a 3-D plot using the Meter component.
To insert the components and configure the Plot component:
Insert a Plot and Meter component. For information on displaying the Maple palettes, see the Show Palettes help page.
Click the Plot component to open the context panel.
In the Plot Expression field, enter plot3d(x^2*cos(y), x =-1 .. 1, y=-2*Pi .. 2*Pi);.
To configure the Meter component so that it changes the transparency of the plot:
Click the Meter component to display the context panel.
Set the following values:
Value at Highest Position=1
Current Position=0.5
Spacing of Major Tick Marks=0.25
Spacing of Minor Tick Marks=0.125
Select Enable Input
Select Continuous Update on Drag
Click Edit Value Changed Code.
This launches the Code Editor dialog.
Before the end use; statement in the dialog, enter the following command:
SetProperty("Plot0", value, plot3d(x^2*cos(y), x=-1..1, y=-2*Pi..2*Pi, transparency=GetProperty("Meter0", value)));
Note: Ensure the names of the components are correct (that is, that they match the Name fields for their components).
Click or from the File menu, select Save Code to accept all changes.
From the File menu, select Close Code Editor.
When you change the value of the Meter component (by moving its needle), the transparency of the 3-D plot changes to the value you set.
See Also
DocumentTools
DocumentTools[GetProperty]
DocumentTools[SetProperty]
EmbeddedComponents
Download Help Document