javascript-ej1-demos/Sunburst/animation.html

106 строки
3.5 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../content/bootstrap.min.css" rel="stylesheet">
<link href="../content/ejthemes/default-theme/ej.web.all.min.css" rel="stylesheet" />
<link href="../content/default.css" rel="stylesheet" />
<link href="../content/default-responsive.css" rel="stylesheet" />
<!--[if lt IE 9]>
<script src="../scripts/jquery-1.11.3.min.js" type="text/javascript"></script>
<!--<![endif]-->
<!--[if gte IE 9]><!-->
<script src="../scripts/jquery-3.4.1.min.js" type="text/javascript"></script>
<!--<![endif]-->
<script src="../scripts/ej.web.all.min.js" type="text/javascript"></script>
<script src="../scripts/properties.js" type="text/javascript"></script>
<script src="../scripts/Sunburst_Data.js"></script>
</head>
<body>
<div class="content-container-fluid">
<div class="row">
<div class="cols-sample-area">
<div id="container">
</div>
</div>
<div id="sampleProperties">
<div class="prop-grid">
<div class="row">
<div class="col-md-3">
Enable Animation
</div>
<div class="col-md-3 aligntop">
<input type="checkbox" checked="checked" id="enable" onchange="visible()" />
</div>
</div>
<div class="row" style="margin: 10px 0;">
<div class="col-md-3">
Animation Type
</div>
<div class="col-md-3 aligntop">
<select name="selectIndex" autocomplete="off" id="animationtype" style="width:100px;">
<option value="0" selected>Rotation</option>
<option value="1">FadeIn</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
var data = window.animation_DataSource;
$("#container").ejSunburstChart({
dataSource: data ,
enableAnimation: true,
valueMemberPath: "Population",
levels: [
{ groupMemberPath: "Continent" },
{ groupMemberPath: "Country" },
{ groupMemberPath: "State" }
],
dataLabelSettings:{visible:true},
tooltip:{visible:true},
innerRadius: 0.2,
size: {height: "600" },
title: { text: "Population Details" },
legend: { visible:true, position: "top" },
load: "loadSunBurstTheme",
});
});
function visible()
{
var sunburst = $("#container").ejSunburstChart("instance");
if ($("#enable").is(":checked"))
sunburst.model.enableAnimation = true;
else {
sunburst.model.enableAnimation = false;
}
sunburst.redraw();
}
function animationTypeChanged(sender)
{
var option = sender.selectedText;
var sunburst = $("#container").ejSunburstChart("instance");
switch (option) {
case 'Rotation':
sunburst.model.animationType = 'rotation';
break;
case 'FadeIn':
sunburst.model.animationType = 'fadeIn';
break;
}
sunburst.redraw();
}
$("#animationtype").ejDropDownList({ "change": "animationTypeChanged", width: "100px",selectedItemIndex:0 });
$("#sampleProperties").ejPropertiesPanel();
</script>
</body>
</html>