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
|
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;