Chart attach to layout problem

var ChartData = {view:“bar”, value:“#sales#”, width:30, xAxis:{template:“#year#”}, yAxis:{start:0, end:100, step:2}};

chart_LoginLog = layout_LoginLog.cells(‘b’).attachChart(ChartData);

chart_LoginLog.parse(dataset, “json”);

These is My Code,

But, It have Error.

What is wrong?

var dataset = [
{ id:1, sales:20, year:“02”},
{ id:2, sales:55, year:“03”},
{ id:3, sales:40, year:“04”},
{ id:4, sales:78, year:“05”},
{ id:5, sales:61, year:“06”},
{ id:6, sales:35, year:“07”},
{ id:7, sales:80, year:“08”},
{ id:8, sales:50, year:“09”},
{ id:9, sales:65, year:“10”},
{ id:10, sales:59, year:“11”}
];

The same code works correctly locally.
Are you using latest version (3.6) ?

If issue still occurs - please provide any kind of sample or demo link where it can be checked

I’m using ver 3.5

I will doublecheck the 3.5 logic, but as dhtmlxChart is fully backward compatible - it must not be a problem to update chart to 3.6

layout_LoginLog = new dhtmlXLayoutObject(document.body, '2E'); layout_LoginLog.cells('a').hideHeader(); layout_LoginLog.cells('b').hideHeader(); layout_LoginLog.cells("a").setHeight(100); layout_LoginLog.cells("a").fixSize(false, true); //툴바 생성 tool_LoginLog = layout_LoginLog.cells('a').attachToolbar(); tool_LoginLog.setIconsPath('./resources/icons/'); tool_LoginLog.addButton("btn_Search","1","Search","Search.png",""); tool_LoginLog.addSeparator("sep1","2"); var formData = [ {type:"block", width:1000, list : [ {type:"label", label: "Admin - Manage Login Log", name: "List_title", className: "List_title", labelWidth: 550} ] }, {type:"block", offsetTop:8, width:1000, list: [ {type:"calendar", offsetLeft:20, name:"cal_DateStart", inputHeight:18, label:"Date" , labelWidth:40, inputWidth:80, weekStart:7, dateFormat:"%Y-%m-%d", serverDateFormat: "%Y-%m-%d"}, {type:"newcolumn", offset:8}, {type:"calendar", inputHeight:18, name:"cal_DateEnd", label:"~", labelWidth:12, inputWidth:80, weekStart:7, dateFormat:"%Y-%m-%d", serverDateFormat: "%Y-%m-%d"}, {type:"newcolumn"} ] } ]; var dataset = [ { id:1, sales:20, year:"02"}, { id:2, sales:55, year:"03"}, { id:3, sales:40, year:"04"}, { id:4, sales:78, year:"05"}, { id:5, sales:61, year:"06"}, { id:6, sales:35, year:"07"}, { id:7, sales:80, year:"08"}, { id:8, sales:50, year:"09"}, { id:9, sales:65, year:"10"}, { id:10, sales:59, year:"11"} ]; form_LoginLog = layout_LoginLog.cells('a').attachObject("form_div"); form_LoginLog = new dhtmlXForm("form_container",formData); form_LoginLog.setItemValue("cal_DateStart", gfn_GetToday()); form_LoginLog.setItemValue("cal_DateEnd", gfn_GetToday()); var ChartData = {view:"bar", container:"chart_div", value:"#sales#", width:30, xAxis:{template:"#year#"}, yAxis:{start:0, end:100, step:2}}; chart_LoginLog = layout_LoginLog.cells('b').attachObject("chart_div"); chart_LoginLog = new dhtmlXChart(ChartData); //chart_LoginLog.parse(dataset, "json"); This is my code

The only problem which I can see - the chart’s container has not height, and with above code it will have zero height by default ( which can lead to js errors in IE )

You can change chart’s container like next

    <div id="chart_div" style='height:100%;'></div>