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