first commit
[wnstats.git] / public / javascripts / jqplot / examples / meterGauge.html
blobbbb278ef64d63c3cd23a8d88c3222aaca2e76f96
1 <!DOCTYPE html>
3 <html>
4 <head>
6 <title>Meter Gauge</title>
8 <link class="include" rel="stylesheet" type="text/css" href="../jquery.jqplot.min.css" />
9 <link rel="stylesheet" type="text/css" href="examples.min.css" />
10 <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCoreDefault.min.css" />
11 <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemejqPlot.min.css" />
13 <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="../excanvas.js"></script><![endif]-->
14 <script class="include" type="text/javascript" src="../jquery.min.js"></script>
17 </head>
18 <body>
19 <div class="logo">
20 <div class="nav">
21 <a class="nav" href="../../../index.php"><span>&gt;</span>Home</a>
22 <a class="nav" href="../../../docs/"><span>&gt;</span>Docs</a>
23 <a class="nav" href="../../download/"><span>&gt;</span>Download</a>
24 <a class="nav" href="../../../info.php"><span>&gt;</span>Info</a>
25 <a class="nav" href="../../../donate.php"><span>&gt;</span>Donate</a>
26 </div>
27 </div>
28 <div class="example-content">
30 <div class="example-nav">
31 <a href="meritOrder.html">Previous</a> <a href="./">Examples</a> <a href="multipleBarColors.html">Next</a></div>
34 <!-- Example scripts go here -->
37 <style type="text/css">
39 .plot {
40 margin-bottom: 30px;
41 margin-left: auto;
42 margin-right: auto;
45 #chart0 .jqplot-meterGauge-label {
46 font-size: 10pt;
49 #chart1 .jqplot-meterGauge-tick {
50 font-size: 6pt;
53 #chart2 .jqplot-meterGauge-tick {
54 font-size: 8pt;
57 #chart3 .jqplot-meterGauge-tick, #chart0 .jqplot-meterGauge-tic {
58 font-size: 10pt;
61 #chart4 .jqplot-meterGauge-tick, #chart4 .jqplot-meterGauge-label {
62 font-size: 12pt;
64 </style>
67 <p>A meter gauge plot shows a data value in a speedometer style gauge. The "series" in consists of a single data value that positions the needle on the gauge. The span of the gauge will be automatically determined, or can be set with the "min" and "max" values in the "rendererOptions" of the series. The plot below also specifies a chart title and a "label" for the gauge.</p>
69 <div id="chart0" class="plot" style="width:250px;height:170px;"></div>
71 <p>For small gauges, it can be desirable to turn off the tick labels by setting the "showTickLabels" option in the rendererOptions to false. Also, colored interval bands can be specified. The interval ranges are specified as an array of values the "intervals" option and custom colors for each interval can be specified with the "intervalColors" option.</p>
73 <div id="chart1" class="plot" style="width:120px;height:80px;"></div>
75 <p>The inner and outer radii of the interval band will automatically adjust when tick Labels are turned on. Also, the gauge minimum and maximum can be specified with the "min" and "max" options in the rendererOptions.</p>
77 <div id="chart3" class="plot" style="width:300px;height:180px;"></div>
79 <p>The inner and outer radii of the interval band can also be specified with the "intervalInnerRadius" and "intervalOuterRadius" options. In the plot below, the "labelPosition" option was set to "bottom" to put the gauge label below the plot. The "labelHeightAdjust" option was set to -5 to raise the label slightly (5 pixels) to place it closer to the gauge.</p>
80 <p>The gauge automatically resizes to best fit the container. The font size of the tick labels and gauge labels do not size to the container, however. The font size of the tick labels can be controlled by styling the css ".jqplot-meterGauge-ticks" class and the gauge label by the "jqplot-meterGauge-label" class.</p>
81 <div id="chart4" class="plot" style="width:500px;height:300px;"></div>
84 <script type="text/javascript" class="code">
85 $(document).ready(function(){
86 s1 = [1];
88 plot0 = $.jqplot('chart0',[s1],{
89 title: 'Network Speed',
90 seriesDefaults: {
91 renderer: $.jqplot.MeterGaugeRenderer,
92 rendererOptions: {
93 label: 'MB/s'
96 });
97 });
98 </script>
100 <script type="text/javascript" class="code">
101 $(document).ready(function(){
102 s1 = [1];
104 plot1 = $.jqplot('chart1',[s1],{
105 seriesDefaults: {
106 renderer: $.jqplot.MeterGaugeRenderer,
107 rendererOptions: {
108 showTickLabels: false,
109 intervals:[2,3,4],
110 intervalColors:['#66cc66', '#E7E658', '#cc6666']
115 </script>
117 <script type="text/javascript" class="code">
118 $(document).ready(function(){
119 s1 = [322];
121 plot3 = $.jqplot('chart3',[s1],{
122 seriesDefaults: {
123 renderer: $.jqplot.MeterGaugeRenderer,
124 rendererOptions: {
125 min: 100,
126 max: 500,
127 intervals:[200, 300, 400, 500],
128 intervalColors:['#66cc66', '#93b75f', '#E7E658', '#cc6666']
133 </script>
135 <script type="text/javascript" class="code">
136 $(document).ready(function(){
137 s1 = [52200];
139 plot4 = $.jqplot('chart4',[s1],{
140 seriesDefaults: {
141 renderer: $.jqplot.MeterGaugeRenderer,
142 rendererOptions: {
143 label: 'Metric Tons per Year',
144 labelPosition: 'bottom',
145 labelHeightAdjust: -5,
146 intervalOuterRadius: 85,
147 ticks: [10000, 30000, 50000, 70000],
148 intervals:[22000, 55000, 70000],
149 intervalColors:['#66cc66', '#E7E658', '#cc6666']
154 </script>
155 <!-- End example scripts -->
157 <!-- Don't touch this! -->
160 <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
161 <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
162 <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
163 <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
164 <!-- End Don't touch this! -->
166 <!-- Additional plugins go here -->
168 <script class="include" type="text/javascript" src="../plugins/jqplot.meterGaugeRenderer.min.js"></script>
170 <!-- End additional plugins -->
173 </div>
174 <script type="text/javascript" src="example.min.js"></script>
176 </body>
179 </html>