Layout - Chart - Grid

Hello,

I’m using layout to display an updating form, grid and chart.

everything works fine apart the chart.

i have tried to the chart to the layout using.

the layout is “3L” configuration with toolbar and pop window.


repChart = layout.cells("c").attachChart(conChart)
repChart.parse(repGrid,"dhtmlxgrid")

var conChart=({
view:"bar",
value:"#data3#,#data4#"
})

no chart appears at all. i also tried to display the chart with window when user clicks “View Chart” in the toolbar. no success :frowning:

please help me out. thanks in advanced.
omar.zip (1.53 MB)

Hi,
I’m currently having the same problem. and I’m waiting for the support reply.
Are you using dhtmlx complete files ? (dhtmlx.js and dhtmlx.css)

if yes, you should try with the separate js and css files (example : dhtmlxcommon.js, dhtmlxgrid.css etc…)

Regards

Hi angelweb,

yes I use the complete files!

for now I would wait for the support before I use the separate js/css files.

Hi all
Here is a sample with separated files: chant in layout cell.
12.11.06.rar (796 KB)

Hi Darya and Angelweb,

it seems these three componenants are not working in a single dhtmlx.js and dhtmlx.css.

Another question in this occasion:

Would the chart be working in a window using a button in the toolbar?

You mean click the toolbar button in the window and load chart?

Yes.

On the toolbar click button called “View Chart” --> window pops up showing the chart.
the chart should use data from the grid within the window.

Hello,
I confirm it doesn’t work with only dhtml.js file.
I worked this around in adding the dhtmlxchart.js in my head section.

Bye

Hi,

I’ve added the dhtmlxchart.js to the header.

And I use this code to load the chart, but it appears only one straight black line across the bottom of layout.cells(“c”).

Data2 and Data3 represent the grid columns 2 & 3

repChart = layout.cells("c").attachChart({
view:"bar",
value:"#data2#,#data3#",
label:"#data2#,#data3#",
color: "#66ccff",
gradient: "3d",
width:5,
height:10,
legend: {
	width: 75,
	align: "right",
	valign: "middle"
}

})
repChart.parse(repGrid,"dhtmlxgrid")

Hi Omar,

we have checked your demo:

there is “chartWin is undefined” error in line:
var repChart = chartWin.attachChart(conChart)

Please check this.

I have attached the fixed dhtmlx.js that will solve the problem with “dhtmlxgrid” data driver.

Also there is an issue in your code:

value:“#data3#,#data4#”

You may define only one field as a value if can be either:
value:“#data3#”
or
value:“#data4#”

If you want to display several series of bar charts, you may use addSeries method (please see samples in chart package).
dhtmlx.zip (267 KB)

Hi Alexandra,

thanks for your support. Your suggesstion has worked fine.