1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
3 | <head> |
---|
4 | <title></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 | <link href="../../themes/rocket/jquery-wijmo.css" rel="stylesheet" type="text/css" /> |
---|
11 | <script src="../../external/jquery-1.8.0.min.js" type="text/javascript"></script> |
---|
12 | <script src="../../external/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script> |
---|
13 | <script src="../../external/raphael-min.js" type="text/javascript"></script> |
---|
14 | <script src="../../wijmo/jquery.wijmo.raphael.js" type="text/javascript"></script> |
---|
15 | <script src="../../wijmo/jquery.wijmo.wijgauge.js" type="text/javascript"></script> |
---|
16 | <script src="../../wijmo/jquery.wijmo.wijlineargauge.js" type="text/javascript"></script> |
---|
17 | <script type="text/javascript"> |
---|
18 | $(document).ready(function () { |
---|
19 | var labels = ["Low", "Stable", "Moderate", "High", "Danger Zone"]; |
---|
20 | function formatLabels(str) { |
---|
21 | return labels[str]; |
---|
22 | } |
---|
23 | |
---|
24 | $("#gauge").wijlineargauge({ |
---|
25 | width: 400, |
---|
26 | height: 120, |
---|
27 | value: 4, |
---|
28 | max: 4, |
---|
29 | min: 0, |
---|
30 | labels: { |
---|
31 | format: formatLabels, |
---|
32 | style: { |
---|
33 | fill: "#1E395B", |
---|
34 | "font-size": 12, |
---|
35 | "font-weight": 800 |
---|
36 | } |
---|
37 | }, |
---|
38 | tickMajor: { |
---|
39 | position: "inside", |
---|
40 | offset: -11, |
---|
41 | interval: 1, |
---|
42 | factor: 12, |
---|
43 | style: { |
---|
44 | fill: "#1E395B", |
---|
45 | stroke: "none", |
---|
46 | width: 2 |
---|
47 | } |
---|
48 | }, |
---|
49 | tickMinor: { |
---|
50 | position: "inside", |
---|
51 | offset: -11, |
---|
52 | visible: true, |
---|
53 | interval: 0.25, |
---|
54 | factor: 10, |
---|
55 | style: { |
---|
56 | fill: "#1E395B", |
---|
57 | stroke: "none", |
---|
58 | width: 1 |
---|
59 | } |
---|
60 | }, |
---|
61 | pointer: { |
---|
62 | shape: "rect", |
---|
63 | length: 0.6, |
---|
64 | style: { |
---|
65 | fill: "#1E395B", |
---|
66 | stroke: "#7BA0CC", |
---|
67 | "stroke-width": 1, |
---|
68 | opacity: 1 |
---|
69 | } |
---|
70 | }, |
---|
71 | face: { |
---|
72 | style: { |
---|
73 | fill: "270-#FFFFFF-#D9E3F0", |
---|
74 | stroke: "#7BA0CC", |
---|
75 | "stroke-width": 2 |
---|
76 | } |
---|
77 | }, |
---|
78 | ranges: [{ |
---|
79 | startValue: 20, |
---|
80 | endValue: 80, |
---|
81 | startDistance: 0.85, //A ratio value determine the location of the range at start value. |
---|
82 | endDistance: 0.85, //A ratio value determine the location of the range at end value. |
---|
83 | startWidth: 0.5, |
---|
84 | endWidth: 0.5, |
---|
85 | style: { |
---|
86 | fill: "90-#3DA1D8-#3A6CAC", |
---|
87 | opacity: "1", |
---|
88 | stroke: "none" |
---|
89 | } |
---|
90 | }] |
---|
91 | }); |
---|
92 | |
---|
93 | }); |
---|
94 | |
---|
95 | </script> |
---|
96 | </head> |
---|
97 | <body class="demo-single"> |
---|
98 | <div class="container"> |
---|
99 | <div class="header"> |
---|
100 | <h2> |
---|
101 | Custom Labels</h2> |
---|
102 | </div> |
---|
103 | <div class="main demo"> |
---|
104 | <!-- Begin demo markup --> |
---|
105 | <div id="gauge" class="ui-corner-all"> |
---|
106 | |
---|
107 | </div> |
---|
108 | <!-- End demo markup --> |
---|
109 | <div class="demo-options"> |
---|
110 | <!-- Begin options markup --> |
---|
111 | <!-- End options markup --> |
---|
112 | </div> |
---|
113 | </div> |
---|
114 | <div class="footer demo-description"> |
---|
115 | <p>This sample demonstrates how to use the wijlineargauge widget to create an linear gauge with custom labels.</p> |
---|
116 | </div> |
---|
117 | </div> |
---|
118 | </body> |
---|
119 | </html> |
---|