knockout.js - DIsplaying graph using knock out and kendo chart -
i need display graph using kendo chart , knockout js. graph not displayed in page. problem greatful.
below html page
<!doctype html> <html> <head> <link href="kendo.common.min.css" rel="stylesheet" /> <link href="kendo.default.min.css" rel="stylesheet" /> <script src="jquery-3.1.1.js"></script> <script src="bootstrap.min.js"></script> <script type="knockout-3.4.0.js"></script> <script src="kendo.all.min.js"></script> </head> <body> <div id="countrygraph" class="k-chart" style="position: relative; touch-action: none; " data-bind="kendochart: { data: countryusers, title: { text: '' }, legend:{position: 'top'},series: usercount, seriescolors: ['lightgreen'], axisdefaults: {categories:countryname } }"> </div> </body> </html>
below js file .
function countrymodel() { self = this; self.countryusers = ko.observablearray([]); function addusercountry(countryname, usercount) { return { countryname: ko.observable(countryname), usercount: ko.observable(usercount) } } self.countryusers().push(new addusercountry('india',1)); self.countryusers().push(new addusercountry('usa',2)); self.countryusers().push(new addusercountry('uk',1)); } $(document).ready(function () { ko.applybindings(new countrymodel()); });
Comments
Post a Comment