# StripChart Widget

    Application Header file	<Xaw/StripChart.h>

    Class Header file	<Xaw/StripCharP.h>

    Class		stripChartWidgetClass

    Class Name	StripChart

    Superclass	Simple

The StripChart widget is used to provide a roughly real time graphical chart of a single value. For example, it is used by the common client program `xload` to provide a graph of processor load. The StripChart reads data from an application, and updates the chart at the `update` interval specified.

## Resources

When creating a StripChart widget instance, the following resources are retrieved from the argument list or from the resource database:

Name | Class | Type | Notes | Default Value
--- | --- | --- | --- | ---
accelerators | Accelerators | AcceleratorTable |  | NULL
ancestorSensitive | AncestorSensitive | Boolean | D | True
background | Background | Pixel |  | XtDefaultBackground
backgroundPixmap | Pixmap | Pixmap |  | XtUnspecifiedPixmap
borderColor | BorderColor | Pixel |  | XtDefaultForeground
borderPixmap | Pixmap | Pixmap |  | XtUnspecifiedPixmap
borderWidth | BorderWidth | Dimension |  | 1
colormap | Colormap | Colormap |  | Parent's Colormap
cursor | Cursor | Cursor |  | None
cursorName | Cursor | String |  | NULL
depth | Depth | int | C | Parent's Depth
destroyCallback | Callback | XtCallbackList |  | NULL
foreground | Foreground | Pixel |  | XtDefaultForeground
getValue | Callback | XtCallbackList |  | NULL
height | Height | Dimension |  | 120
highlight | Foreground | Pixel |  | XtDefaultForeground
insensitiveBorder | Insensitive | Pixmap |  | GreyPixmap
international | International | Boolean | C | False
jumpScroll | JumpScroll | int | A | half the width of the widget
mappedWhenManaged | MappedWhenManaged | Boolean |  | True
minScale | Scale | int |  | 1
pointerColor | Foreground | Pixel |  | XtDefaultForeground
pointerColorBackground | Background | Pixel |  | XtDefaultBackground
screen | Screen | Pointer | R | Parent's Screen
sensitive | Sensitive | Boolean |  | True
translations | Translations | TranslationTable |  | NULL
update | Interval | int |  | 10
width | Width | Dimension |  | 120
x | Position | Position |  | 0
y | Position | Position |  | 0

`foreground`

  A pixel value which indexes the widget's colormap to derive the color that will be used to draw the graph.

`getValue`

  A list of callback functions to call every `update` seconds. This list should contain one function, which returns the value to be graphed by the StripChart widget. The following section describes the procedural interface. Behavior when this list has more than one function is undefined.

`highlight`

  A pixel value which indexes the widget's colormap to derive the color that will be used to draw the scale lines on the graph.

`jumpScroll`

  When the graph reaches the right edge of the window it must be scrolled to the left. This resource specifies the number of pixels it will jump. Smooth scrolling can be achieved by setting this resource to 1.

`minScale`

  The minimum scale for the graph. The number of divisions on the graph will always be greater than or equal to this value.

`update`

  The number of seconds between graph updates. Each update is represented on the graph as a 1 pixel wide line. Every `update` seconds the `getValue` procedure will be used to get a new graph point, and this point will be added to the right end of the StripChart.

## Getting the StripChart Value

The StripChart widget will call the application routine passed to it as the `getValue` callback function every `update` seconds to obtain another point for the StripChart graph.

The calling interface for the `getValue` callback is:

       void(*getValueProc)
      Widget w
      XtPointer client_data
      XtPointer value

w

  Specifies the StripChart widget.

client_data

  Specifies the client data.

value

  Returns a pointer to a double. The application should set the address pointed to by this argument to a double containing the value to be graphed on the StripChart.

This function is used by the StripChart to call an application routine. The routine will pass the value to be graphed back to the the StripChart in the `value` field of this routine.