smartadmin's donut chart

init donut chart:
// DO NOT REMOVE : GLOBAL FUNCTIONS!
pageSetUp();
// PAGE RELATED SCRIPTS
/*
* Load related scripts
* and append to header
*/
// Load morris dependency 1
loadScript("js/plugin/morris/raphael.2.1.0.min.js", loadMorrisEngine);
// Load morris dependency 2
function loadMorrisEngine() {
loadScript("js/plugin/morris/morris.min.js", runMorrisCharts);
}
/*
* Run all morris chart on this page
*/
function runMorrisCharts(){
// donut
if ($('#donut-graph').length){
Morris.Donut({
element: 'donut-graph',
data: [
{value: 70, label: 'foo'},
{value: 15, label: 'bar'},
{value: 10, label: 'baz'},
{value: 5, label: 'A really really long label'}
],
formatter: function (x) { return x + "%"}
});
}
}

浙公网安备 33010602011771号