Class: Histogram

STX.Renderer. Histogram


new Histogram(config)

Creates a Histogram renderer See STX.Renderer#construct for parameters required by all renderers

Parameters:
Name Type Description
config Object

Config for renderer

Properties
Name Type Argument Description
params object <optional>

Parameters to control the renderer itself

Properties
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. Default: false.

widthFactor number <optional>

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

heightPercentage number <optional>

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

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>
"overlaid"

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

Examples
var axis2=new STXChart.YAxis();
axis2.position="left";

				// configure the histogram display
				var params={
					yAxis: axis2,
					name:				"Sentiment Data",
					type:				"histogram",
					subtype:			"stacked",
					heightPercentage:	.7,	 // how high to go. 1 = 100%
					opacity:			.7,  // only needed if supporting IE8, otherwise can use rgba values in histMap instead
					widthFactor:		.8	 // to control space between bars. 1 = no space in between
				};

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

  				histRenderer=stxx.setSeriesRenderer(new STX.Renderer.Histogram({params: params, callback: histogramLegend}));

				stxx.addSeries("^NIOALL", {display:"Symbol 1",data:{useDefaultQuoteFeed:true}});
				stxx.addSeries("^NIOAFN", {display:"Symbol 2",data:{useDefaultQuoteFeed:true}});
				stxx.addSeries("^NIOAMD", {display:"Symbol 3",data:{useDefaultQuoteFeed:true}});

	      		histRenderer.removeAllSeries()
				.attachSeries("^NIOALL","#6B9CF7")
				.attachSeries("^NIOAFN","#95B7F6")
				.attachSeries("^NIOAMD","#B9D0F5")
				.ready();  //use ready() to immediately draw the histogram
// 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
      		renderer.removeAllSeries(true);
      		// detach the series renderer from the chart.
      		stxx.removeSeriesRenderer(renderer);
      		// delete the renderer itself.
      		delete renderer;