Interaction between grid and chart with json Datasource


i have used the DHTMLX3 -designer to build an application, with different cells, with an grid in cell a and an chart in cell b.
I am using the example from … ntegration , which seems to work with data from an xml-file, but i am using a json-file which contains my data.

I am using the following layout

var main_layout = new dhtmlXLayoutObject(document.body, ‘4H’);

and a grid like the following:

var a = main_layout.cells('a');
var grid_2 = a.attachGrid();

if (stage == 2)
return true;

a chart like the following:

var chart_2 = c.attachChart({
view: ‘bar’ ,
gradient: false,

chart_2.load("data/testdata5.js", 'json');

and the function refresh_chart from the example:

function refresh_chart(){

When i have filtered the data in the grid and klick on the header of the grid, the chart_ 2 is cleared and i get a line from the x-axis and a number of colored legend marker which are labelled as undefined.

I don´t know, where the problem is originated.
Perhaps it is because the example uses div-objects in html for showing the grid and and the chart and i am using an dhtmlXLayoutObject or if it is a problem with the parsing of the data from grid to chart.
I guess my problem is within the "chart_2.parse(grid_2,“dhtmlxgrid”); ", but i am not sure
I have to parse an object to the chart, that the chart recognized. When i looked into the objects, which can be parsed to an chart-object, i have not found any examples for parsing data from an grid-object.

Is there anywhere an example like the above … ntegration
but only with an json data source instead of an XML-Datasource ?

Thanks for looking at my problem.

It does not matter where you load the data to the grid from.
Please, provide with a complete demo, where the issue can be reproduced.
Here is the tutorial: … leted_demo


Thank you for your help.

I have solved the problem by now.
First i have rearranged the script sources in the header and than i changed the line grid_2.load(“data/testdata.js”,refresh_Chart(),‘js’); to
and now it seems to work.