1 | <!doctype html> |
---|
2 | <html lang="en"> |
---|
3 | <head> |
---|
4 | <title>BarChart - Series Transition</title> |
---|
5 | <meta charset="utf-8" /> |
---|
6 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> |
---|
7 | <meta name="description" content="%description%" /> |
---|
8 | <meta name="keywords" content="" /> |
---|
9 | <meta name="author" content="ComponentOne" /> |
---|
10 | |
---|
11 | <link href="../../themes/rocket/jquery-wijmo.css" rel="stylesheet" type="text/css" /> |
---|
12 | |
---|
13 | <script src="../../external/jquery-1.8.0.min.js" type="text/javascript"></script> |
---|
14 | <script src="../../external/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script> |
---|
15 | <script src="../../external/globalize.min.js" type="text/javascript"></script> |
---|
16 | <script src="../../external/raphael-min.js" type="text/javascript"></script> |
---|
17 | <script src="../../wijmo/jquery.wijmo.raphael.js" type="text/javascript"></script> |
---|
18 | <script src="../../wijmo/jquery.wijmo.wijchartcore.js" type="text/javascript"></script> |
---|
19 | <script src="../../wijmo/jquery.wijmo.wijbarchart.js" type="text/javascript"></script> |
---|
20 | <script id="scriptInit" type="text/javascript"> |
---|
21 | $(document).ready(function () { |
---|
22 | $("#wijbarchart").wijbarchart({ |
---|
23 | axis: { |
---|
24 | y: { |
---|
25 | text: "Number of Hits", |
---|
26 | autoMax: false, |
---|
27 | max: 100, |
---|
28 | autoMin: false, |
---|
29 | min: 0 |
---|
30 | |
---|
31 | }, |
---|
32 | x: { |
---|
33 | text: "Month of the Year" |
---|
34 | } |
---|
35 | }, |
---|
36 | hint: { |
---|
37 | content: function () { |
---|
38 | return this.data.label + '\n ' + this.y + ''; |
---|
39 | } |
---|
40 | }, |
---|
41 | stacked: true, |
---|
42 | clusterRadius: 5, |
---|
43 | seriesList: [createRandomSeriesList("2010")] |
---|
44 | }); |
---|
45 | }); |
---|
46 | |
---|
47 | |
---|
48 | function changeProperties() { |
---|
49 | var seriesTransition = {}; |
---|
50 | enabled = $("#chkEnabled").is(":checked"), |
---|
51 | duration = $("#inpDuration").val(), |
---|
52 | easing = $("#selEasing").val(); |
---|
53 | seriesTransition.enabled = enabled; |
---|
54 | if (duration && duration.length) { |
---|
55 | seriesTransition.duration = parseFloat(duration); |
---|
56 | } |
---|
57 | seriesTransition.easing = easing; |
---|
58 | $("#wijbarchart").wijbarchart("option", "seriesTransition", seriesTransition); |
---|
59 | } |
---|
60 | |
---|
61 | function reload() { |
---|
62 | $("#wijbarchart").wijbarchart("option", "seriesList", [createRandomSeriesList("2010")]); |
---|
63 | } |
---|
64 | |
---|
65 | function createRandomSeriesList(label) { |
---|
66 | var data = [], |
---|
67 | randomDataValuesCount = 12, |
---|
68 | labels = ["January", "February", "March", "April", "May", "June", |
---|
69 | "July", "August", "September", "October", "November", "December"], |
---|
70 | idx; |
---|
71 | for (idx = 0; idx < randomDataValuesCount; idx++) { |
---|
72 | data.push(createRandomValue()); |
---|
73 | } |
---|
74 | return { |
---|
75 | label: label, |
---|
76 | legendEntry: false, |
---|
77 | data: { x: labels, y: data } |
---|
78 | }; |
---|
79 | } |
---|
80 | |
---|
81 | function createRandomValue() { |
---|
82 | var val = Math.round(Math.random() * 100); |
---|
83 | return val; |
---|
84 | } |
---|
85 | </script> |
---|
86 | </head> |
---|
87 | <body class="demo-single"> |
---|
88 | <div class="container"> |
---|
89 | <div class="header"> |
---|
90 | <h2> |
---|
91 | Animation</h2> |
---|
92 | </div> |
---|
93 | <div class="main demo"> |
---|
94 | <!-- Begin demo markup --> |
---|
95 | <input type="button" value="reload" onclick="reload()" /> |
---|
96 | <div id="wijbarchart" class="ui-widget ui-widget-content ui-corner-all" style="width: 756px; height: 475px"> |
---|
97 | </div> |
---|
98 | <!-- End demo markup --> |
---|
99 | <div class="demo-options"> |
---|
100 | <!-- Begin options markup --> |
---|
101 | <div> |
---|
102 | <label for="chkEnabled"> |
---|
103 | Series Transition Settings: Enabled |
---|
104 | </label> |
---|
105 | <input id="chkEnabled" type="checkbox" checked="checked" /> |
---|
106 | <label for="inpDuration"> |
---|
107 | Duration |
---|
108 | </label> |
---|
109 | <input id="inpDuration" type="text" value="1000" /> |
---|
110 | <label for="selEasing"> |
---|
111 | Easing |
---|
112 | </label> |
---|
113 | <select id="selEasing"> |
---|
114 | <option value=">">></option> |
---|
115 | <option value="<"><</option> |
---|
116 | <option value="<>"><></option> |
---|
117 | <option value="backIn">backIn</option> |
---|
118 | <option value="backOut">backOut</option> |
---|
119 | <option value="bounce">bounce</option> |
---|
120 | <option value="elastic">elastic</option> |
---|
121 | </select> |
---|
122 | <input type="button" value="Apply" onclick="changeProperties()" /> |
---|
123 | </div> |
---|
124 | <!-- End options markup --> |
---|
125 | </div> |
---|
126 | </div> |
---|
127 | <div class="footer demo-description"> |
---|
128 | <p>This sample demonstrates how to set the seriesTransition of your barcharts. This example uses the <b>seriesTransition</b> option of the bar chart.</p> |
---|
129 | |
---|
130 | </div> |
---|
131 | </div> |
---|
132 | </body> |
---|
133 | </html> |
---|