Scroll bar won't appear when layout resize

Hi
Use one of the next 2 event handlers to redraw your chart or its container (or ssomething else):

  1. onResizeFinish - this event occures in case of window-inited layout and calls user-defined handlers (if there are any) when parent window was resized
  2. onPanelResizeFinish - this event calls user-defined handlers (if there are any)
    docs.dhtmlx.com/doku.php?id=dhtm … api_events

hi Darya,

I tried the same as per below code, but it doesn’t work, there could be something wrong in my code at the end, can you pls have a look?

regards,
suminda,
//********************************************
ncat.create_tab=function(id,full_id,text,extra){
full_id=full_id||ncat.get_id_chain(ncat.mytree0,id);
if (!ncat.pages[full_id]){
var details=id.split("^")
ncat.mytabmid.addTab(full_id, full_id, 100);
var win=ncat.mytabmid.cells(full_id);
//using window instead of tab
ncat.mytabmid.setTabActive(full_id);
ncat.mytabmid.setLabel(full_id,extra||ncat.mytree0.getItemText(id));

    var toolbar=win.attachToolbar();
	//toolbar.setSkin("glassy_blue");
	toolbar.attachEvent("onClick",ncat.tab_toolbar_click)
	toolbar.setIconsPath("imgs/tabtoolbar/")
	toolbar.loadXML("xml/tabtoolbar/toolbar_"+details[0]+".xml?etc="+new Date().getTime());
    
    switch(details[0]){

    case "chart":
	ncat.set_chart_table(win,text,extra);
        break;
    }
    ncat.pages[full_id]=win;
    win.extra=extra;
}
else ncat.mytabmid.setTabActive(full_id); 

};

//*********************************************************************
ncat.set_chart_table=function(win,text,recid){
//arrange variable div
var did="";
var possible=“abcdefghijklmnopqrstuvwxyz”;
for( var i=0; i < 4; i++ ){
did +=possible.charAt(Math.floor(Math.random() * possible.length));
}
var divTag = document.createElement(“div”);
divTag.id = did;
divTag.style.height = “500px”;
divTag.style.width = “1000px”;
divTag.style.overflow = “auto”;

//starting hichart *************************************************************************************
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-ohlcv.json&callback=?’, function(data) {

	// split the data set into ohlc and volume
	var ohlc = [],
		volume = [],
		dataLength = data.length;
		
	for (i = 0; i < dataLength; i++) {
		ohlc.push([
			data[i][0], // the date
			data[i][1], // open
			data[i][2], // high
			data[i][3], // low
			data[i][4] // close
		]);
		
		volume.push([
			data[i][0], // the date
			data[i][5] // the volume
		])
	}

// set the allowed units for data grouping*********************************************************
var groupingUnits = [[
‘week’, // unit name
[1] // allowed multiples
], [
‘month’,
[1, 2, 3, 4, 6]
]];

// create the chart**********************************************************************************
chart = new Highcharts.StockChart({
chart: {
renderTo: did,
alignTicks: false,
zoomType: ‘x’
},

	    rangeSelector: {
	        selected: 1
	    },

	    title: {
	        text: 'AAPL Historical'
	    },

	    yAxis: [{
	        title: {
	            text: 'OHLC'
	        },
	        height: 200,
	        lineWidth: 2
	    }, {
	        title: {
	            text: 'Volume'
	        },
	        top: 300,
	        height: 100,
	        offset: 0,
	        lineWidth: 2
	    }],
	    
	    series: [{
	        type: 'candlestick',
	        name: 'AAPL',
	        data: ohlc,
	        dataGrouping: {
				units: groupingUnits
	        }
	    }, {
	        type: 'column',
	        name: 'Volume',
	        data: volume,
	        yAxis: 1,
	        dataGrouping: {
				units: groupingUnits
	        }
	    }]
	});
});

//handle resize even*******************************************************************
ncat.dhxLayout.attachEvent(“onPanelResizeFinish”,function(){
chart.redraw();
});
//attach obect to window************************************************************
var obj = win.attachObject(divTag);
};


So, you need overflow:auto for chart container.

hi darya,

I did the same as in 11th line in 2nd function, but strange is its not working. any idea?

regards,
suminda

Here is a vorking demo with layout and scroll for you.
layout.rar (154 KB)

Hi,

It’s working fine,

many thanks,

regards,
suminda,


You are welcome!

useful topic. Thank you for sharing.
it may improve my knowledge of DHTMLX.
Thanks.
new shower faucet