Yes, of course!
Bar type sample is below (you can replace it with previous for test):
[code]function doOnLoad(){
formData = [{
type: “settings”,
position: “label-left”,
inputWidth: 100
}, {
type: “input”,
name: “inp1”,
value: 20
}, {
type: “input”,
name: “inp2”,
value: 30
}, {
type: “input”,
name: “inp3”,
value: 40
}, {
type: “button”,
value: “Count”,
name: “btn”,
width: 60
}, {
type: “button”,
value: “Clear”,
name: “btn_cl”,
width: 60
}];
myForm = new dhtmlXForm(“form1”, formData);
pieChart = new dhtmlXChart({
view:“bar”,
container:“chart1”,
value:"#sales#",
label:function(obj){
return obj.sales
},
color:"#color#",
legend:{
width: 75,
align:“right”,
valign:“middle”,
template:"#month#"
},
xAxis:{
template:"’#month#"
},
yAxis:{
title:“Profit”
}
});
my_dataset = [
{ sales: 20, month:“area1”, color: “#ee3639” },
{ sales: 30, month:“area2”, color: “#ee9e36” },
{ sales: 40, month:“area3”, color: “#eeea36” }
];
pieChart.parse(my_dataset,“json”);
myForm.attachEvent("onButtonClick", function(id){
if(id=="btn"){
my_dataset[0].sales = myForm.getItemValue("inp1");
my_dataset[1].sales = myForm.getItemValue("inp2");
my_dataset[2].sales = myForm.getItemValue("inp3");
pieChart.parse(my_dataset,"json");
}
if(id=="btn_cl"){
pieChart.clearAll();
}
})
}[/code]