mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-03 01:01:41 +00:00
132 lines
3.6 KiB
HTML
Executable File
132 lines
3.6 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Binding to local data</title>
|
|
<meta charset="utf-8">
|
|
<link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.common.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.mobile.min.css" rel="stylesheet">
|
|
<script src="../../js/jquery.min.js"></script>
|
|
<script src="../../js/jszip.min.js"></script>
|
|
<script src="../../js/kendo.all.min.js"></script>
|
|
<script src="../content/shared/js/console.js"></script>
|
|
<script>
|
|
|
|
</script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<a class="offline-button" href="../index.html">Back</a>
|
|
|
|
<div id="example">
|
|
<div class="demo-section k-content wide">
|
|
<h4>Website optimization stats</h4>
|
|
<div id="before"></div>
|
|
<div id="after"></div>
|
|
</div>
|
|
<script>
|
|
var dataBefore = [{
|
|
description: "All Visitors",
|
|
visitors: 23945
|
|
}, {
|
|
description: "Tried the Demos",
|
|
visitors: 19156
|
|
}, {
|
|
description: "Downloaded",
|
|
visitors: 13984
|
|
}, {
|
|
description: "Requested a Quote",
|
|
visitors: 3216
|
|
}, {
|
|
description: "Purchased",
|
|
visitors: 1673
|
|
}];
|
|
|
|
var dataAfter = [{
|
|
description: "All Visitors",
|
|
visitors: 28536
|
|
},{
|
|
description: "Tried the Demos",
|
|
visitors: 26539
|
|
},{
|
|
description: "Downloaded",
|
|
visitors: 23088
|
|
},{
|
|
description: "Requested a Quote",
|
|
visitors: 13853
|
|
},{
|
|
description: "Purchased",
|
|
visitors: 9697
|
|
}];
|
|
|
|
function createChart(chartName, data,description) {
|
|
$("#"+chartName).kendoChart({
|
|
title: {
|
|
text: description,
|
|
margin: {
|
|
top: 10,
|
|
bottom: 10,
|
|
left: -5
|
|
}
|
|
},
|
|
legend: {
|
|
visible: false
|
|
},
|
|
dataSource: {
|
|
data: data
|
|
},
|
|
series: [{
|
|
type: "funnel",
|
|
dynamicSlope:true,
|
|
field: "visitors",
|
|
categoryField: "description",
|
|
dynamicHeight : false,
|
|
labels: {
|
|
color:"black",
|
|
visible: true,
|
|
background: "transparent",
|
|
template: "#= category #: #= value#",
|
|
align: "left"
|
|
}
|
|
}],
|
|
tooltip: {
|
|
visible: true,
|
|
template: "#= category # #= kendo.format('{0:p}',value/dataItem.parent()[0].visitors)#"
|
|
}
|
|
});
|
|
}
|
|
|
|
function createCharts() {
|
|
createChart("before", dataBefore, "Before optimization");
|
|
createChart("after", dataAfter, "After optimization");
|
|
}
|
|
|
|
$(document).ready(createCharts);
|
|
$(document).bind("kendo:skinChange", createCharts);
|
|
</script>
|
|
<style>
|
|
.demo-section {
|
|
text-align: center;
|
|
}
|
|
|
|
.k-chart {
|
|
display: inline-block;
|
|
width: 30%;
|
|
height: 350px;
|
|
}
|
|
|
|
#before {
|
|
margin-right: 20px;
|
|
}
|
|
</style>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|