HorizontalGauge

HorizontalGauge[value]

draws a linear gauge showing value in a range of 0 to 1.

HorizontalGauge[value,{min,max}]

draws a linear gauge showing value in a range of min to max.

HorizontalGauge[Dynamic[value],]

allows value to be set interactively using the gauge.

HorizontalGauge[{value1,value2,},]

draws a gauge showing multiple values.

Details and Options

  • Values less than min or greater than max are clipped to the respective limits.
  • Undefined values or bad input is taken to be missing and typically displays the min value.
  • Units may be assigned to value, min, and max by using Quantity.
  • The units do not need to be the same, but must be compatible.
  • HorizontalGauge has the same options as Graphics, with the following additions and changes:
  • GaugeFaceElementFunctionAutomaticfunction to draw the face
    GaugeFaceStyleNonestyle for the gauge face
    GaugeFrameElementFunctionAutomaticfunction to draw the frame
    GaugeFrameSizeAutomatichow large to make the gauge frame
    GaugeFrameStyleNonestyle for the gauge frame
    GaugeLabelsNonelabels for the gauge
    GaugeMarkersAutomaticappearance for the marker
    GaugeStyleAutomaticstyle for gauge markers
    MethodAutomaticmethod to use
    PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
    PlotTheme$PlotThemetheme to use for drawing the gauge
    ScaleDivisionsAutomaticthe number and distribution of ticks
    ScaleOriginAutomaticwhere to position the scale in the gauge
    ScalePaddingAutomatichow to draw the space around the scale
    ScaleRangesNonethe sections of the scale to be styled
    ScaleRangeStyleAutomatichow to draw the scale ranges
    ScalingFunctionsNonescaling functions for the gauge
    TargetUnitsAutomaticunits to display in the gauge
  • GaugeLabels can take the following forms:
  • Noneno gauge labels
    Automaticinclude units as labels
    Fullinclude units and a value as labels
    Allinclude all values as labels
    "Value"include values as labels
    "Unit"include units as labels
    labeluse label as a label
    Placed[label,pos]place label at position pos
    {label1,label2,}use multiple labels
  • GaugeLabels->Placed[label,pos] can use the positions pos:
  • Top,Bottom,Left,Right,Centerpositions within the dial
    bsposition along the scale
    Scaled[bs]scaled position along the scale
    {bx,by}scaled position {bx,by} in the gauge
    {pos,{lx,ly}}scaled position {lx,ly} in the label at general position pos in the gauge
  • A list of built-in settings for GaugeMarkers, GaugeFaceElementFunction, and GaugeFrameElementFunction can be obtained from ChartElementData["HorizontalGauge"]. A visual gallery is available in the Chart Element Schemes palette.
  • GaugeMarkers->Placed[marker,location] can be used to control where the marker is placed in the gauge. The possible locations are:
  • "DivisionCenter"cumulative markers centered on division marks
    "DivisionInterval"cumulative markers between division marks
    "Scale"within the scale region
    "Center"marker centered on the scale
    "OppositeScale"within the scale region on the side of the axis opposite the ticks
    "ScaleRange"cumulative marker within the scale region
    "Frame"within the dial frame
  • ScaleOrigin can take the following values (using the default vertical scale orientation for reference):
  • rhorizontal postion of the scale
    Top,Bottomon which side of the face to center the scale axis
    {ymin,ymax}vertical locations of min and max for the scale
    {horizontal,vertical}horizontal and vertical locations for the scale
  • ScalePadding can take the following forms:
  • pthe same horizontal and vertical padding
    {pr,py}different horizontal and vertical padding
    {{px left,px right},...}different padding on each side of the axis etc.
  • TargetUnits->Automatic automatically selects the units based on the input. If no units are present, none will be displayed.
  • TargetUnits->unit displays unit in the gauge, even if no units were present in the input.

Examples

open allclose all

Basic Examples  (4)

Generate a dial gauge for a particular value:

Generate a gauge using values with units:

Generate a gauge that displays multiple values:

Generate a dial gauge with an interactive value:

Scope  (22)

Data and Layouts  (7)

Data values do not have to be within the range of the scale:

Nonreal data is taken to be missing and typically uses the min value of the gauge:

The min and max specified are sorted so that the smaller number of the list is always the min:

Generate a gauge using values with units:

Specify the displayed units with TargetUnits:

Change the position of the scale:

Specify a constant horizontal and vertical padding:

Use Dynamic to make an interactive gauge:

Styling and Appearance  (9)

Use a theme to control the overall appearance:

Combine the theme with other options:

Use explicit styles for the markers:

Use any gradient or indexed color schemes from ColorData to style the markers:

Change the type of markers used:

Change where the markers are placed:

Position the marker in the frame:

Use any graphic or image for the marker:

Change the style of the face of the gauge:

Change the style of the frame around the gauge:

Specify ranges of the scale to be colored by the index on the dial face:

Labeling and Legending  (6)

Use GaugeLabels to add a label to the gauge face:

Add a display of the scale value:

Add a display of the gauge units:

Show units and scale value:

Use Placed to change the location of the label on the face of the gauge:

Use a list to specify more than one label:

Options  (69)

Background  (1)

Insert a background color behind the gauge:

Use GaugeFaceStyle to set the face style:

GaugeFaceElementFunction  (3)

List built-in settings for GaugeFaceElementFunction:

For detailed settings use Palettes ChartElementSchemes:

Write a custom GaugeFaceElementFunction:

GaugeFaceStyle  (3)

Specify the style for the gauge face:

Use None to turn off the face:

Use a Texture as a gauge face:

GaugeFrameElementFunction  (2)

List built-in settings for GaugeFrameElementFunction:

For detailed settings use Palettes ChartElementSchemes:

GaugeFrameSize  (3)

Use an explicit width in the graphics coordinate system to draw the frame:

Use None to turn off the frame:

Use named sizes for the frame:

GaugeFrameStyle  (1)

Use directives to change the rendering of the gauge frame:

GaugeLabels  (9)

Show the value as a label:

Specify a label:

Labels can be any expression:

Use Placed to control label placement:

Position labels at values along the scale:

Position labels using a scaled coordinate system along the scale:

Use a scaled coordinate system over the entire gauge:

Place all labels at the middle of the scale and vary the coordinates within the label:

Use a list to specify more than one label:

GaugeMarkers  (9)

Turn the markers on and off:

List built-in settings for GaugeMarkers:

For detailed settings use Palettes ChartElementSchemes:

Use an image or graphic for a marker:

Use Placed to change the location of the marker:

Position the marker in the frame:

Fill a cumulative bar to the value:

Fill segments that are centered on division values:

Sequential markers are activated when the value rounds to the division value:

Fill segments that are between division values:

Sequential markers are activated when the value is greater than or equal to the division value:

Use an image or graphic for a cumulative marker:

GaugeStyle  (5)

Style the gauge marker:

By default different styles are chosen for multiple markers:

Specify a list of styles:

Use any gradient or indexed color schemes from ColorData:

Specify the style for cumulative markers up to the gauge value:

Specify an additional style for markers beyond the gauge value:

LabelStyle  (1)

Style the labels:

PerformanceGoal  (2)

Generate a gauge with tooltips on the gauge markers:

Emphasize performance by disabling interactive behaviors:

PlotTheme  (4)

Create gauges using a variety of base themes:

Specify a theme with minimal elements:

Change the gauge color:

The "Sparkline" theme fits gauges in the surrounding text:

ScaleDivisions  (2)

Specify the total number of ticks:

Specify the number of major and minor ticks:

ScaleOrigin  (3)

Use ScaleOrigin to specify a vertical offset for the scale:

Specify a starting and ending position for the scale:

Specify a horizontal position and vertical extent for the scale:

ScalePadding  (3)

Use automatically determined padding around the scale:

Specify a constant horizontal and vertical padding:

Use a scaled value for the constant horizontal and vertical padding:

Specify different horizontal and vertical padding on each side:

ScaleRanges  (7)

Highlight a range of values on the scale:

Specify multiple ranges:

Style the entire region behind the scale:

Ranges need not be contiguous or distinct:

Directly associate a style with a range with range->style:

ScaleRanges draw in front of the gauge face:

Change the scale range width:

ScaleRangeStyle  (7)

By default, the scale ranges are colored with a gradient based on the marker color:

Apply a style to all of the ranges:

Use a list of styles to draw the ranges:

Use ScaleRangeStyle->{None,style} to apply a style to the scale only:

Apply a style to the backgrounds and foregrounds of all the ranges:

Color the scale ranges with built-in color schemes:

Define a one-dimensional color function:

TargetUnits  (2)

By default, units are determined automatically:

Specify the displayed units:

TicksStyle  (2)

Specify overall ticks style:

Use None to not draw ticks:

Applications  (6)

Visualize leaf count for successive integrals:

Monitor memory used by processes with a indicator of the max memory used:

Monitor how long the kernel has been running and how much time has been spent in computation:

Monitor progress when integrating a differential equation:

Monitor where NIntegrate is focusing on approximating the integral:

Monitor progress when integrating a differential equation:

Visualize the spectral lines of elements:

Introduced in 2012
 (9.0)
 |
Updated in 2014
 (10.0)