<script src="Scripts/jquery-1.10.2.min.js"></script>
<script src="Scripts/knockout.min.js"></script>
<script src="Scripts/ej.chart.min.js"></script>
<script src="Scripts/ej.widget.ko.min.js"></script> |
<div id="Chart" data-bind="ejChart: { }"></div> |
commonSeriesOptions:{ dataSource:dataSource}, series:[{xName:'EmployeeID', yName:'Value', name:'Product', type:'line'}],
xZoomFactor:xZoomFactor , yZoomFactor:yZoomFactor,xZoomPosition:xZoomPosition ,yZoomPosition:yZoomPosition,
<script type="text/javascript">
function setData(number, year) {
var data = [];
for (var i = 0; i < number; i++) {
var y = Math.random() * 10;
var points =
[
{ "EmployeeID": new Date(year, 1, i), "Value": y },
];
data.push(points[0]);
}
return data;
}
var obj = setData(179, 2000);
window.employeeView =
{
enable: ko.observable(true),
xZoomFactor:ko.observable(1),
yZoomFactor:ko.observable(1),
xZoomPosition:ko.observable(0),
yZoomPosition: ko.observable(0),
dataSource: ko.observableArray(obj),
};
ko.applyBindings(employeeView);
</script> |
function getData(number, year) {
for (var i = 0; i < 5; i++) {
data = setData(number, year);
maindata.push(data);
}
return maindata;
} |
buttonclick: function () {
visibility: true;
var chart = this;
obj = getData(100, 2002);
var j = 0;
setInterval(function ()
{
chart.dataSource(null);
if (j < obj.length){
chart.dataSource(obj[j]);
j = j + 1;
}
else {
j = 0;
chart.dataSource(obj[j]);
}
}, 1000);
}, |
var dataManger = new ej.DataManager({
});
var query = ej.Query().from("Orders").take(10); |
series:[{dataSource:dataManger,xName:'ShipCity', yName:'Freight', name:'Product', query: chartquery , type:'column’ }], |
window.employeeView =
{
enable: ko.observable(true),
xZoomFactor: ko.observable(1),
yZoomFactor: ko.observable(1),
xZoomPosition: ko.observable(0),
yZoomPosition: ko.observable(0),
chartquery: query,
};
ko.applyBindings(employeeView); |