Hi there,
I simply want to re-run an example of chart coloring shown in
[url]Chart Coloring DHTMLX Docs.
But I always get an error where codre reads “index++”, telling me that an object is expected.
Is there any qualifier or declaration needed?
<script>
window.onload = function(){
var barChart = new dhtmlXChart({
view: "pie",
container: "chartDiv",
value: "#sales#",
color: function(obj){
index++;
if (index % 2) {
return "#ff9900";
}
else {
return "#66cc00";
}
}
});
barChart.parse(dataset, "json");
}
</script>
<div id="chartDiv" style="width:600px;height:450px;margin:20px;border:1px solid #A4BED4;">
</div>
thanks a lot!