[dhtmlxLayout]Can we add Chart component?

G’day.

I tried to add dhtmlxChart. However I could not add chart.
Is there any “.addChart()” function?

docs.dhtmlx.com/doku.php?id=dhtm … xattaching
The following components can be attached to dhtmlxLayout’s items:
dhtmlxTree;
dhtmlxGrid;
dhtmlxTreeGrid;
dhtmlxTabbar;
dhtmlxAccordion;
dhtmlxFolders;
dhtmlxMenu;
dhtmlxToolbar;
dhtmlxEditor;
Status Bar.

Thanks in advance

Hello,

Please try dhxLayout.cells(id).attachChart();

Example:

var myChart = dhxLayout.cells(“a”).attachChart({
view:“pie”,
value:"#sales#",
pieInnerText:"#sales#",
gradient:true,
details:{
width: 75,
align:“right”,
valign:top,
marker:{
type:“round”,
width:15
},
template:"#year#"
}
});

Is the method attachChart() available in every dhtmlxLayout version? I am trying to use it but i am getting an error and I cannot even find it in the documentation.

Code excerpt

var b = main_layout.cells('b');
var chart_1 = b.attachChart({
		view: 'pie3D',
		value: '#valor#' ,
		tooltip:{
			template:'#valor#'
		},
		cant:0.5,
		legend:{
			template: '#tipo#',
			marker:{
				type:'square',
				width: 25,
				height: 15
			}
		},
		gradient: false
	});

	chart_1.load('data/chart.php', 'xml');

This is the error

b.attachChart is not a function

Is the method attachChart() available in every dhtmlxLayout version?

You need include dhtmlxChart libraries. Please have a look at the sample with dhtmlxWindows:

dhtmlxSuite/dhtmlxChart/samples/09_integration/03_windows.html