~ubuntu-branches/ubuntu/quantal/maas/quantal-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/docs/charts/charts-timeaxis.html

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html>
2
 
<html lang="en">
3
 
<head>
4
 
    <meta charset="utf-8">
5
 
    <title>Example: Create a Chart with a Time Axis</title>
6
 
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.4.0pr3/build/cssgrids/grids-min.css">
7
 
    <link rel="stylesheet" href="../assets/css/main.css">
8
 
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
9
 
    <script src="../../build/yui/yui-min.js"></script>
10
 
</head>
11
 
<body>
12
 
 
13
 
<div id="doc">
14
 
    <h1>Example: Create a Chart with a Time Axis</h1>
15
 
 
16
 
    
17
 
 
18
 
    <div class="yui3-g">
19
 
        <div id="main" class="yui3-u">
20
 
            <div class="content"><style scoped>
21
 
#mychart {
22
 
    margin:10px 10px 10px 10px;
23
 
    width:90%;
24
 
    max-width: 800px;
25
 
    height:400px;
26
 
}
27
 
</style>
28
 
<div class="intro">
29
 
<p>This example shows how to create a <code>Chart</code> with a Time Axis.</p>
30
 
</div>
31
 
<div class="example">
32
 
<div id="mychart"></div>
33
 
<script type="text/javascript">
34
 
(function() {
35
 
    YUI().use('charts', function (Y) 
36
 
    { 
37
 
        var myDataValues = [ 
38
 
            {date:"1/1/2010", miscellaneous:2000, expenses:3700, revenue:2200}, 
39
 
            {date:"2/1/2010", miscellaneous:50, expenses:9100, revenue:100}, 
40
 
            {date:"3/1/2010", miscellaneous:400, expenses:1100, revenue:1500}, 
41
 
            {date:"4/1/2010", miscellaneous:200, expenses:1900, revenue:2800}, 
42
 
            {date:"5/1/2010", miscellaneous:500, expenses:7000, revenue:2650},
43
 
            {date:"6/1/2010", miscellaneous:3000, expenses:4700, revenue:1200}, 
44
 
            {date:"7/1/2010", miscellaneous:6550, expenses:6500, revenue:1100}, 
45
 
            {date:"8/1/2010", miscellaneous:4005, expenses:2600, revenue:3500}, 
46
 
            {date:"9/1/2010", miscellaneous:1200, expenses:8900, revenue:3800}, 
47
 
            {date:"10/1/2010", miscellaneous:2000, expenses:1000, revenue:3650},
48
 
            {date:"11/1/2010", miscellaneous:2000, expenses:3700, revenue:2200}, 
49
 
            {date:"12/1/2010", miscellaneous:5000, expenses:3100, revenue:4100}
50
 
        ];
51
 
        
52
 
        var mychart = new Y.Chart({
53
 
                                dataProvider:myDataValues, 
54
 
                                render:"#mychart", 
55
 
                                styles: {
56
 
                                        axes: { 
57
 
                                                date: { 
58
 
                                                        label: {
59
 
                                                                rotation: -45
60
 
                                                        }
61
 
                                                }
62
 
                                        }
63
 
                                }, 
64
 
                                categoryKey:"date", 
65
 
                                categoryType:"time"
66
 
                        });
67
 
    });
68
 
})();
69
 
</script>
70
 
 
71
 
</div>
72
 
<h3>This example shows how to create a Chart with a Time Axis.</h3>
73
 
 
74
 
 
75
 
<p>When plotting data across a range of dates, it's sometimes preferred to use <code>TimeAxis</code> instead of a <code>CategoryAxis</code>. While a <code>CategoryAxis</code> plots ticks on an
76
 
axis for each data point on a graph, a <code>TimeAxis</code> plots ticks evenly across a time range. A <code>TimeAxis</code> can be applied to a Chart by setting its <code>categoryType</code>
77
 
 attribute to "time".</p>
78
 
 
79
 
<pre class="code prettyprint">var myDataValues = [ 
80
 
    {date:&quot;1&#x2F;1&#x2F;2010&quot;, miscellaneous:2000, expenses:3700, revenue:2200}, 
81
 
    {date:&quot;2&#x2F;1&#x2F;2010&quot;, miscellaneous:50, expenses:9100, revenue:100}, 
82
 
    {date:&quot;3&#x2F;1&#x2F;2010&quot;, miscellaneous:400, expenses:1100, revenue:1500}, 
83
 
    {date:&quot;4&#x2F;1&#x2F;2010&quot;, miscellaneous:200, expenses:1900, revenue:2800}, 
84
 
    {date:&quot;5&#x2F;1&#x2F;2010&quot;, miscellaneous:500, expenses:7000, revenue:2650},
85
 
    {date:&quot;6&#x2F;1&#x2F;2010&quot;, miscellaneous:3000, expenses:4700, revenue:1200}, 
86
 
    {date:&quot;7&#x2F;1&#x2F;2010&quot;, miscellaneous:6550, expenses:6500, revenue:1100}, 
87
 
    {date:&quot;8&#x2F;1&#x2F;2010&quot;, miscellaneous:4005, expenses:2600, revenue:3500}, 
88
 
    {date:&quot;9&#x2F;1&#x2F;2010&quot;, miscellaneous:1200, expenses:8900, revenue:3800}, 
89
 
    {date:&quot;10&#x2F;1&#x2F;2010&quot;, miscellaneous:2000, expenses:1000, revenue:3650},
90
 
    {date:&quot;11&#x2F;1&#x2F;2010&quot;, miscellaneous:2000, expenses:3700, revenue:2200}, 
91
 
    {date:&quot;12&#x2F;1&#x2F;2010&quot;, miscellaneous:5000, expenses:3100, revenue:4100}
92
 
];
93
 
 
94
 
var mychart = new Y.Chart({
95
 
                        dataProvider:myDataValues, 
96
 
                        render:&quot;#mychart&quot;, 
97
 
                        styles: {
98
 
                                axes: { 
99
 
                                        date: { 
100
 
                                                label: {
101
 
                                                        rotation: -45
102
 
                                                }
103
 
                                        }
104
 
                                }
105
 
                        }, 
106
 
                        categoryKey:&quot;date&quot;, 
107
 
                        categoryType:&quot;time&quot;
108
 
                });</pre>
109
 
 
110
 
</div>
111
 
        </div>
112
 
 
113
 
        <div id="sidebar" class="yui3-u">
114
 
            
115
 
 
116
 
            
117
 
                <div class="sidebox">
118
 
                    <div class="hd">
119
 
                        <h2 class="no-toc">Examples</h2>
120
 
                    </div>
121
 
 
122
 
                    <div class="bd">
123
 
                        <ul class="examples">
124
 
                            
125
 
                                
126
 
                                    <li data-description="Shows how to use Charts to create a basic chart.">
127
 
                                        <a href="charts-simple.html">Basic Charts Implementation</a>
128
 
                                    </li>
129
 
                                
130
 
                            
131
 
                                
132
 
                                    <li data-description="Shows how to create a chart with multiple series.">
133
 
                                        <a href="charts-multiseries.html">Chart with Multiple Series</a>
134
 
                                    </li>
135
 
                                
136
 
                            
137
 
                                
138
 
                                    <li data-description="Shows how to create a column chart with multiple series.">
139
 
                                        <a href="charts-column.html">Specify Chart Type</a>
140
 
                                    </li>
141
 
                                
142
 
                            
143
 
                                
144
 
                                    <li data-description="Shows how to create a column chart with a stacked numeric axis.">
145
 
                                        <a href="charts-stackedcolumn.html">Create Stacked Chart</a>
146
 
                                    </li>
147
 
                                
148
 
                            
149
 
                                
150
 
                                    <li data-description="Shows how to create a chart with a time axis.">
151
 
                                        <a href="charts-timeaxis.html">Create a Chart with a Time Axis</a>
152
 
                                    </li>
153
 
                                
154
 
                            
155
 
                                
156
 
                                    <li data-description="Shows how to add gridlines to a chart.">
157
 
                                        <a href="charts-gridlines.html">Add Gridlines to a Chart</a>
158
 
                                    </li>
159
 
                                
160
 
                            
161
 
                                
162
 
                                    <li data-description="Shows how to create a chart with planar based events.">
163
 
                                        <a href="charts-stackedarea.html">Create a Stacked Area Chart with Planar Based Events</a>
164
 
                                    </li>
165
 
                                
166
 
                            
167
 
                                
168
 
                                    <li data-description="Shows how to use a chart&#x27;s styles attribute to customize a chart.">
169
 
                                        <a href="charts-globalstyles.html">Customize a Chart</a>
170
 
                                    </li>
171
 
                                
172
 
                            
173
 
                                
174
 
                                    <li data-description="Shows how to customize the default tooltip of a chart.">
175
 
                                        <a href="charts-customizedtooltip.html">Customize a Chart&#x27;s Tooltip</a>
176
 
                                    </li>
177
 
                                
178
 
                            
179
 
                                
180
 
                                    <li data-description="Shows how to explicitly define the axes and series for a chart.">
181
 
                                        <a href="charts-objectstyles.html">Define a Chart&#x27;s Axes and Series</a>
182
 
                                    </li>
183
 
                                
184
 
                            
185
 
                                
186
 
                                    <li data-description="Shows how to use charts to create a pie chart.">
187
 
                                        <a href="charts-pie.html">Pie Chart</a>
188
 
                                    </li>
189
 
                                
190
 
                            
191
 
                                
192
 
                                    <li data-description="Shows how to create a chart with multiple value axes.">
193
 
                                        <a href="charts-dualaxes.html">Dual Axes Chart</a>
194
 
                                    </li>
195
 
                                
196
 
                            
197
 
                                
198
 
                                    <li data-description="Shows how to access a chart instance&#x27;s value axis after the chart has rendered.">
199
 
                                        <a href="charts-axisupdate.html">Update Chart Axis</a>
200
 
                                    </li>
201
 
                                
202
 
                            
203
 
                                
204
 
                                    <li data-description="Shows how to access a chart instance&#x27;s seriesCollection after the chart has rendered.">
205
 
                                        <a href="charts-seriesupdate.html">Update Chart Series</a>
206
 
                                    </li>
207
 
                                
208
 
                            
209
 
                        </ul>
210
 
                    </div>
211
 
                </div>
212
 
            
213
 
 
214
 
            
215
 
        </div>
216
 
    </div>
217
 
</div>
218
 
 
219
 
<script src="../assets/vendor/prettify/prettify-min.js"></script>
220
 
<script>prettyPrint();</script>
221
 
 
222
 
</body>
223
 
</html>