I have struggled for a long time now to get a chart integreted with a grid, whats wrong with this?
Can someone please help…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<link rel="stylesheet" href="../common/css/style.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="../codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="../codebase/skins/dhtmlxgrid_dhx_skyblue.css">
<link rel="stylesheet" type="text/css" href="../codebase/dhtmlxchart.css">
<script src="../codebase/dhtmlxcommon.js"></script>
<script src="../codebase/dhtmlxgrid.js"></script>
<script src="../codebase/dhtmlxgridcell.js"></script>
<script src="../codebase/dhtmlxgrid_srnd.js"></script>
<script src="../codebase/datastore.js"></script>
<script src="../codebase/dhtmlxdataprocessor.js" type="text/javascript" charset="utf-8"></script>
<script src="../codebase/connector/connector.js" type="text/javascript" charset="utf-8"></script>
<script src="../codebase/dhtmlxchart.js" type="text/javascript"></script>
</head>
<body>
<table>
<tr>
<td>
<div id="gridstore" style="width:500px;height:200px;background-color:white;overflow:hidden"></div>
</td>
<td>
<div id="chart" style="width:400px;height:200px;background-color:white;overflow:hidden"></div>
</td>
</tr>
</table>
<script>
var lineChart;
lineChart = new dhtmlXChart({
view: "line",
container: "chart",
value: "#data2#",
label: "#data5#",
tooltip: {
template: "#data2#",
},
item: {
borderColor: "#ffffff",
color: "#000000"
},
line: {
color: "#ff9900",
width: 3
}
});
function refresh_chart() {
lineChart.parse(mygridStore, "dhtmlxgrid");
}
</script>
<script>
mygridStore = new dhtmlXGridObject('gridstore');
mygridStore.setImagePath("../codebase/imgs/");
mygridStore.setHeader("Datastore, Capacity, Freespace, Allocated, Unallocated, Date");
mygridStore.setInitWidths("95,75,75,75,75,85")
mygridStore.setColAlign("left,right,right,right,right,center")
mygridStore.setColTypes("ro,ro,ro,ro,dyn,ro");
mygridStore.setColSorting("str,int,int,int,int,connector")
mygridStore.init();
mygridStore.setSkin("dhx_skyblue");
mygridStore.loadXML("grid_store.php?connector=true&dhx_sort[5]=desc",refresh_chart());
</script>
</body>
</html>
I know that my browser can render the image because i have tried a barchart earlier and the start and end values and the grid were drawn. But nothing else…