Class: Histogram

CIQ.Renderer. Histogram

new Histogram(config)

Creates a multi-part histogram renderer where bars can be stacked one on top of the other, clustered next to each other, or overlaid over each other.

See CIQ.Renderer#construct for parameters required by all renderers

Name Type Description
config Object

Config for renderer

Name Type Argument Description
params object <optional>

Parameters to control the renderer itself

Name Type Argument Default Description
defaultBorders boolean <optional>

Whether to draw a border for each bar as a whole. Can be overridden by a border set for a series.

widthFactor number <optional>

Width of each bar as a percentage of the candleWidth. Valid values are 0.00-1.00.

heightPercentage number <optional>

The amount of vertical space to use, valid values are 0.00-1.00.

bindToYAxis boolean <optional>

Set to true to bind the rendering to the y-axis and to draw it. Automatically set if params.yAxis is present.

subtype string <optional>

Subtype of rendering "stacked", "clustered", "overlaid"

Common valid parameters for use by attachSeries.:
fill_color_up - Color to use for up histogram bars.
fill_color_down - Color to use for down histogram bars.
border_color_up - Color to use for the border of up histogram bars.
border_color_down - Color to use for the order of down histogram bars.

  • ChartIQ Advanced Package
// configure the histogram display
		var params={
			name:				"Sentiment Data",
			type:				"histogram",
			subtype:			"stacked",
			heightPercentage:	.7,	 // how high to go. 1 = 100%
			widthFactor:		.8	 // to control space between bars. 1 = no space in between

	 	//legend creation callback (optional)
		function histogramLegend(colors){
	        stxx.chart.legendRenderer(stxx,{legendColorMap:colors, coordinates:{x:260, y:stxx.panels["chart"]}, noBase:true});

		// set the renderer
		var histRenderer=stxx.setSeriesRenderer(new CIQ.Renderer.Histogram({params: params, callback: histogramLegend}));

		// add data and attach. 
		stxx.addSeries("^NIOALL", {display:"Symbol 1"}, function() {histRenderer.attachSeries("^NIOALL","#6B9CF7").ready();});
		stxx.addSeries("^NIOAFN", {display:"Symbol 2"}, function() {histRenderer.attachSeries("^NIOAFN","#95B7F6").ready();});
		stxx.addSeries("^NIOAMD", {display:"Symbol 3"}, function() {histRenderer.attachSeries("^NIOAMD","#B9D0F5").ready();});
// this is an example on how completely remove a renderer and all associated data. 
		// This should only be necessary if you are also removing the chart itself
		// Remove all series from the renderer including series data from the masterData
  		// detach the series renderer from the chart.
  		// delete the renderer itself.
  		delete renderer;