GT::Graphics::Object::Histogram

This graphic object displays a histogram.

used in graphic.pl it takes two arguments, an indicator and a color. it plots vertical bars (histogram) from zone zero to data value.

the histogram default color is "yellow", but can be changed via configuration option "Graphic::Histogram::Color" and by the color parameter on the graphic option statement. in addition the color can be controlled by an indicator as well (see examples).

bars will be clipped at upper and lower zone boundries. clipped bars will display a small arrow at the clipped end. there are two hardcoded variations that set the color of this marker. the old way requires you to edit the file and set the hash variable $self->{'inverse'} in the sub init method to any value.

    $self->{'inverse'} = 'enable';

in this mode the clip marker color will be the inverse of the current color. benefits include good contrast with respect to the histogram especially when an indicator is controlling the color.

currently the clip marker color will be either the default value "blue" or the value set by your configuration option parameter "Graphic::Histogram::ClipColor"


examples

 typical in a graphic config file
   --add=Histogram(I:MACD/3 26 52 20, brown)
   --add=Histogram(I:MACD)
   --add=Histogram(I:VOSC 21, [127,127,127])
   --add=Histogram(I:ADL, "dark blue")
 using indicator to set historgram color: (in options file only)
   Graphic::Histogram::Color Indicators::Generic::If \
    {Signals:Generic:Below {I:Prices OPEN} {I:Prices CLOSE}} green red

$hist->set_color_datasource($ds)

Use the indicated datasource to retrieve the color of the bar.