I have a tab with form containing chart and grid, the height of the chart changes dynamically depending on data, so I need to enable a scrollbar in case the chart grows bigger than the window. How is that done?
moUI.tabbarContent.addTab(oTabProps.ID, sTabLabel, TAB_WIDTH);
oForm = moUI.tabbarContent.cells(oTabProps.ID).attachForm();
.
.
.
var sContainerChart = "<div id='chart_container' style='width:600px;height:300px;'></div>";
var sLine = "<hr>";
var sContainerGrid = "<div id='gridbox' style='width:600px; height:170px; background-color:white;'></div>";
var sContainerForm = sContainerChart + sLine + sContainerGrid;
moUI.tabbarContent.setContentHTML(oTabProps.ID, sContainerForm);
.
.
.
oFormProps.Grid = new dhtmlXGridObject("gridbox");
.
.
.
var nCount = oFormProps.Grid.getUserData("", "Count");
document.getElementById('chart_container').style.height = nCount * 10 + 100 + "px";
oFormProps.Chart = new dhtmlXChart({
view: "barH",
color: "#66ccff",
container: "chart_container",
value: "#data2#",
label: "#data1#",
width: 10,
orogin: 0,
yAxis: {
start: oGrid.getUserData("", "MaxValue"),
step: oGrid.getUserData("", "Step"),
end: oGrid.getUserData("", "MinValue")
},
xAxis: {
template: "#Alarm#"
}
});
oFormProps.Chart.clearAll();
oFormProps.Chart.parse(oFormProps.Grid, "dhtmlxgrid");
oFormProps.Chart.render();