EZwgl (4.36 Histogram)

## 4.36 Histogram

A histogram displays an array of vertical or horizontal bars, representing an array of floating point values. The size of the array, the number of bins is controled by the `EZ_HISTOGRAM_SAMPLE` resource. If this resource value is 0, it displays a dynamic array. The range of the histogram is controlled by the `EZ_BAR_RANGE` resource. The default range is [0, 100]. The width of the bars is controlled by the `EZ_BAR_WIDTH` resource. The colors of the bars is set by the `EZ_BAR_COLOR_N` resource.

### Widget Info

Symbolic widget type | EZ_WIDGET_HISTOGRAM
Default class name | "Histogram"
Default instance name | "histogram"

### Widget Interface Routines

`void EZ_SetHistogramValues(EZ_Widget *widget, float *values, int nvalues);`

set histogram bin values.

`void EZ_SetHistogramValue(EZ_Widget *widget, float value);`

set the value for the next bin. Used in progressing histograms.

`float EZ_GetHistogramValue(EZ_Widget *widget, int n);`

retrieve the nth value.

`int EZ_GetHistogramSelection(EZ_Widget *widget, float *value_return);`

retrieve the last selected bin and its value.

`float EZ_SetHistogramRange(EZ_Widget *widget, float frm, float to);`

set the range.

`void EZ_SetHistogramColors(EZ_Widget *widget, unsigned long *colors, int ncolors);`

set bar colors, `ncolors` is should be smaller than 12.

### Screenshot

### Resources

Config_Option | ResourceName | DefaultValue
EZ_CLASS | class | `"GradientBar"`
EZ_NAME | name | `"gradientBar"`

EZ_X | x |
EZ_Y | y |
EZ_WIDTH | width |
EZ_HEIGHT | height |

EZ_LOCATION | location |
EZ_SIZE | size |
EZ_GEOMETRY | geometry |

EZ_WIDTH_HINT | widthHint |
EZ_HEIGHT_HINT | heightHint |
EZ_SIZE_HINT | sizeHint |

EZ_BORDER_WIDTH | borderWidth | `0`
EZ_BORDER_TYPE | borderType | `sunken`

EZ_EXPAND | expand | `false`
EZ_PROPAGATE | propagate | `true`
EZ_TRANSIENT | transient | `false`

EZ_CURSOR | cursor | `"XC_left_ptr"`
EZ_BUBBLE_STRING | bubbleString | `null`

EZ_CALLBACK | N/A | `null null`
EZ_MOTION_CALLBACK | N/A | `null null`
EZ_DESTROY_CALLBACK | N/A | `null null`
EZ_EVENT_HANDLER | N/A | `null null`

EZ_BACKGROUND | background | `"gray74`
EZ_BG_IMAGE_FILE | bgImageFile | `null`
EZ_BG_PIXMAP | N/A | `none`
EZ_SHAPED_WINDOW | shapedWindow | `false`
EZ_SHAPE_FILE | shapeFile | `NULL`
EZ_SHAPE_PIXMAP | N/A | `NULL`

EZ_CLIENT_PTR_DATA | N/A | `null`
EZ_CLIENT_INT_DATA | clientIntData | `0`

EZ_DND_DRAG_CURSOR | dndDragCursor | `none`
EZ_DND_BUBBLE_STRING | dndBubbleString | `null`

EZ_BACKING_STORE | backingStore | `true`

EZ_BAR_EDITABLE | barEditable | `True`
EZ_BAR_ORIENTATION | barOrientation | `EZ_HORIZONTAL`
EZ_BAR_WIDTH | barWidth | `1`
EZ_BAR_RANGE | barRange | `0.0 100.0`
EZ_BAR_COLOR_N | barColorN | `0,green`
EZ_BAR_COLOR_N | barColorN | `1,yellow`
EZ_HISTOGRAM_SAMPLE | histogramSample | `10`

HTML Documentation Maintainance:`Arturo Espinosa <arturo@nuclecu.unam.mx>`