Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / api / Ext.chart.axis.Time.html
1 <!DOCTYPE html><html><head><title>Ext.chart.axis.Time | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
2 <style type="text/css">.head-band { display: none; }
3 .header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
4 .doc-tab .members .member a.more { background-color: #efefef; }
5 </style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
6 </head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
7 <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">
8
9     req = {
10         liveURL: '.',
11         standAloneMode: true,
12         origDocClass: 'Ext.chart.axis.Time',
13         docClass: 'Ext.chart.axis.Time',
14         docReq: 'Ext.chart.axis.Time',
15         version: '4.0',
16         baseURL: '.',
17         baseDocURL: '.',
18         baseProdURL: '.'
19     };
20
21     clsInfo = {};
22
23
24
25 </script>
26
27 <script type="text/javascript" src="../search.js"></script>
28 <!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
29 <script type="text/javascript" src="../class_tree.js"></script>
30 <script type="text/javascript" src="../class_doc.js"></script>
31 <script type="text/javascript">
32     req.source = 'Time3.html#Ext-chart.axis.Time';
33     clsInfo = {"methods":["Time","drawAxis","drawGrid","drawLabel","setTitle"],"cfgs":["dashSize","length","majorTickSteps","minorTickSteps","position","width"],"properties":["aggregateOp","calculateByLabelSize","constrain","dateFormat","fromDate","step","timeUnit","toDate"],"events":[],"subclasses":[]};
34     Ext.onReady(function() {
35         Ext.create('Docs.classPanel');
36     });
37 </script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/Time3.html#Ext-chart.axis.Time" target="_blank">Ext.chart.axis.Time</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><pre class="subclasses"><h4>Hierarchy</h4><div class="subclass f"><a href="Ext.chart.axis.Abstract.html" rel="Ext.chart.axis.Abstract" class="cls docClass">Ext.chart.axis.Abstract</a><div class="subclass"><a href="Ext.chart.axis.Axis.html" rel="Ext.chart.axis.Axis" class="cls docClass">Ext.chart.axis.Axis</a><div class="subclass"><strong>Ext.chart.axis.Time</strong></div></div></div></pre><p>A type of axis whose units are measured in time values. Use this axis
38 for listing dates that you will want to group or dynamically change.
39 If you just want to display dates as categories then use the
40 Category class for axis instead.</p>
41
42 <p>For example:</p>
43
44 <pre class="prettyprint"><code>axes: [{
45     type: 'Time',
46     position: 'bottom',
47     fields: 'date',
48     title: 'Day',
49     dateFormat: 'M d',
50     groupBy: 'year,month,day',
51     aggregateOp: 'sum',
52
53     constrain: true,
54     fromDate: new Date('1/1/11'),
55     toDate: new Date('1/7/11')
56 }]
57 </code></pre>
58
59 <p>In this example we're creating a time axis that has as title <em>Day</em>.
60 The field the axis is bound to is <code>date</code>.
61 The date format to use to display the text for the axis labels is <code>M d</code>
62 which is a three letter month abbreviation followed by the day number.
63 The time axis will show values for dates between <code>fromDate</code> and <code>toDate</code>.
64 Since <code>constrain</code> is set to true all other values for other dates not between
65 the fromDate and toDate will not be displayed.</p>
66 <div class="members"><div class="m-cfgs"><div class="definedBy">Defined By</div><a name="configs"></a><h3 class="cfg p">Config Options</h3><h4 class="cfgGroup">Other Configs</h4><div id="config-dashSize" class="member f inherited"><a href="Ext.chart.axis.Time.html#config-dashSize" rel="config-dashSize" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-cfg-dashSize" class="viewSource">view source</a></div><a name="dashSize"></a><a name="config-dashSize"></a><a href="Ext.chart.axis.Time.html#" rel="config-dashSize" class="cls expand">dashSize</a><span> : Number</span></div><div class="description"><div class="short"><p>The size of the dash marker. Default's 3.</p>
67 </div><div class="long"><p>The size of the dash marker. Default's 3.</p>
68 </div></div></div><div id="config-length" class="member inherited"><a href="Ext.chart.axis.Time.html#config-length" rel="config-length" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-cfg-length" class="viewSource">view source</a></div><a name="length"></a><a name="config-length"></a><a href="Ext.chart.axis.Time.html#" rel="config-length" class="cls expand">length</a><span> : Number</span></div><div class="description"><div class="short"><p>Offset axis position. Default's 0.</p>
69 </div><div class="long"><p>Offset axis position. Default's 0.</p>
70 </div></div></div><div id="config-majorTickSteps" class="member inherited"><a href="Ext.chart.axis.Time.html#config-majorTickSteps" rel="config-majorTickSteps" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-cfg-majorTickSteps" class="viewSource">view source</a></div><a name="majorTickSteps"></a><a name="config-majorTickSteps"></a><a href="Ext.chart.axis.Time.html#" rel="config-majorTickSteps" class="cls expand">majorTickSteps</a><span> : Number</span></div><div class="description"><div class="short"><p>If <code>minimum</code> and <code>maximum</code> are specified it forces the number of major ticks to the specified value.</p>
71 </div><div class="long"><p>If <code>minimum</code> and <code>maximum</code> are specified it forces the number of major ticks to the specified value.</p>
72 </div></div></div><div id="config-minorTickSteps" class="member inherited"><a href="Ext.chart.axis.Time.html#config-minorTickSteps" rel="config-minorTickSteps" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-cfg-minorTickSteps" class="viewSource">view source</a></div><a name="minorTickSteps"></a><a name="config-minorTickSteps"></a><a href="Ext.chart.axis.Time.html#" rel="config-minorTickSteps" class="cls expand">minorTickSteps</a><span> : Number</span></div><div class="description"><div class="short"><p>The number of small ticks between two major ticks. Default is zero.</p>
73 </div><div class="long"><p>The number of small ticks between two major ticks. Default is zero.</p>
74 </div></div></div><div id="config-position" class="member inherited"><a href="Ext.chart.axis.Time.html#config-position" rel="config-position" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-cfg-position" class="viewSource">view source</a></div><a name="position"></a><a name="config-position"></a><a href="Ext.chart.axis.Time.html#" rel="config-position" class="cls expand">position</a><span> : String</span></div><div class="description"><div class="short"><p>Where to set the axis. Available options are <code>left</code>, <code>bottom</code>, <code>right</code>, <code>top</code>. Default's <code>bottom</code>.</p>
75 </div><div class="long"><p>Where to set the axis. Available options are <code>left</code>, <code>bottom</code>, <code>right</code>, <code>top</code>. Default's <code>bottom</code>.</p>
76 </div></div></div><div id="config-width" class="member inherited"><a href="Ext.chart.axis.Time.html#config-width" rel="config-width" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-cfg-width" class="viewSource">view source</a></div><a name="width"></a><a name="config-width"></a><a href="Ext.chart.axis.Time.html#" rel="config-width" class="cls expand">width</a><span> : Number</span></div><div class="description"><div class="short"><p>Offset axis width. Default's 0.</p>
77 </div><div class="long"><p>Offset axis width. Default's 0.</p>
78 </div></div></div></div><div class="m-properties"><a name="properties"></a><div class="definedBy">Defined By</div><h3 class="prp p">Properties</h3><div id="property-aggregateOp" class="member f ni"><a href="Ext.chart.axis.Time.html#property-aggregateOp" rel="property-aggregateOp" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Time.html" class="definedIn docClass">Ext.chart.axis.Time</a><br/><a href="../source/Time3.html#Ext-chart.axis.Time-property-aggregateOp" class="viewSource">view source</a></div><a name="aggregateOp"></a><a name="property-aggregateOp"></a><a href="Ext.chart.axis.Time.html#" rel="property-aggregateOp" class="cls expand">aggregateOp</a><span> : String</span></div><div class="description"><div class="short"><p>Aggregation operation when grouping. Possible options are 'sum', 'avg', 'max', 'min'. Default's 'sum'.</p>
79 </div><div class="long"><p>Aggregation operation when grouping. Possible options are 'sum', 'avg', 'max', 'min'. Default's 'sum'.</p>
80 </div></div></div><div id="property-calculateByLabelSize" class="member ni"><a href="Ext.chart.axis.Time.html#property-calculateByLabelSize" rel="property-calculateByLabelSize" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Time.html" class="definedIn docClass">Ext.chart.axis.Time</a><br/><a href="../source/Time3.html#Ext-chart.axis.Time-property-calculateByLabelSize" class="viewSource">view source</a></div><a name="calculateByLabelSize"></a><a name="property-calculateByLabelSize"></a><a href="Ext.chart.axis.Time.html#" rel="property-calculateByLabelSize" class="cls expand">calculateByLabelSize</a><span> : Boolean</span></div><div class="description"><div class="short"><p>The minimum value drawn by the axis. If not set explicitly, the axis
81 minimum will be calculated automatically.</p>
82 </div><div class="long"><p>The minimum value drawn by the axis. If not set explicitly, the axis
83 minimum will be calculated automatically.</p>
84 </div></div></div><div id="property-constrain" class="member ni"><a href="Ext.chart.axis.Time.html#property-constrain" rel="property-constrain" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Time.html" class="definedIn docClass">Ext.chart.axis.Time</a><br/><a href="../source/Time3.html#Ext-chart.axis.Time-property-constrain" class="viewSource">view source</a></div><a name="constrain"></a><a name="property-constrain"></a><a href="Ext.chart.axis.Time.html#" rel="property-constrain" class="cls expand">constrain</a><span> : Boolean</span></div><div class="description"><div class="short">If true, the values of the chart will be rendered only if they belong between the fromDate and toDate.
85 If false, the ...</div><div class="long"><p>If true, the values of the chart will be rendered only if they belong between the fromDate and toDate.
86 If false, the time axis will adapt to the new values by adding/removing steps.
87 Default's [Ext.Date.DAY, 1].</p>
88 </div></div></div><div id="property-dateFormat" class="member ni"><a href="Ext.chart.axis.Time.html#property-dateFormat" rel="property-dateFormat" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Time.html" class="definedIn docClass">Ext.chart.axis.Time</a><br/><a href="../source/Time3.html#Ext-chart.axis.Time-property-dateFormat" class="viewSource">view source</a></div><a name="dateFormat"></a><a name="property-dateFormat"></a><a href="Ext.chart.axis.Time.html#" rel="property-dateFormat" class="cls expand">dateFormat</a><span> : String|Boolean</span></div><div class="description"><div class="short"><p>Indicates the format the date will be rendered on.
89 For example: 'M d' will render the dates as 'Jan 30', etc.</p>
90 </div><div class="long"><p>Indicates the format the date will be rendered on.
91 For example: 'M d' will render the dates as 'Jan 30', etc.</p>
92 </div></div></div><div id="property-fromDate" class="member ni"><a href="Ext.chart.axis.Time.html#property-fromDate" rel="property-fromDate" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Time.html" class="definedIn docClass">Ext.chart.axis.Time</a><br/><a href="../source/Time3.html#Ext-chart.axis.Time-property-fromDate" class="viewSource">view source</a></div><a name="fromDate"></a><a name="property-fromDate"></a><a href="Ext.chart.axis.Time.html#" rel="property-fromDate" class="cls expand">fromDate</a><span> : Date</span></div><div class="description"><div class="short"><p>The starting date for the time axis.</p>
93 </div><div class="long"><p>The starting date for the time axis.</p>
94 </div></div></div><div id="property-step" class="member ni"><a href="Ext.chart.axis.Time.html#property-step" rel="property-step" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Time.html" class="definedIn docClass">Ext.chart.axis.Time</a><br/><a href="../source/Time3.html#Ext-chart.axis.Time-property-step" class="viewSource">view source</a></div><a name="step"></a><a name="property-step"></a><a href="Ext.chart.axis.Time.html#" rel="property-step" class="cls expand">step</a><span> : Array</span></div><div class="description"><div class="short">An array with two components: The first is the unit of the step (day, month, year, etc). The second one is the number...</div><div class="long"><p>An array with two components: The first is the unit of the step (day, month, year, etc). The second one is the number of units for the step (1, 2, etc.).
95 Default's [Ext.Date.DAY, 1].</p>
96 </div></div></div><div id="property-timeUnit" class="member ni"><a href="Ext.chart.axis.Time.html#property-timeUnit" rel="property-timeUnit" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Time.html" class="definedIn docClass">Ext.chart.axis.Time</a><br/><a href="../source/Time3.html#Ext-chart.axis.Time-property-timeUnit" class="viewSource">view source</a></div><a name="timeUnit"></a><a name="property-timeUnit"></a><a href="Ext.chart.axis.Time.html#" rel="property-timeUnit" class="cls expand">timeUnit</a><span> : String</span></div><div class="description"><div class="short">Indicates the time unit to use for each step. Can be 'day', 'month', 'year' or a comma-separated combination of all o...</div><div class="long"><p>Indicates the time unit to use for each step. Can be 'day', 'month', 'year' or a comma-separated combination of all of them.
97 Default's 'year,month,day'.</p>
98 </div></div></div><div id="property-toDate" class="member ni"><a href="Ext.chart.axis.Time.html#property-toDate" rel="property-toDate" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Time.html" class="definedIn docClass">Ext.chart.axis.Time</a><br/><a href="../source/Time3.html#Ext-chart.axis.Time-property-toDate" class="viewSource">view source</a></div><a name="toDate"></a><a name="property-toDate"></a><a href="Ext.chart.axis.Time.html#" rel="property-toDate" class="cls expand">toDate</a><span> : Date</span></div><div class="description"><div class="short"><p>The ending date for the time axis.</p>
99 </div><div class="long"><p>The ending date for the time axis.</p>
100 </div></div></div></div><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-Time" class="member f ni"><a href="Ext.chart.axis.Time.html#method-Time" rel="method-Time" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Time.html" class="definedIn docClass">Ext.chart.axis.Time</a><br/><a href="../source/Time3.html#Ext-chart.axis.Time-method-constructor" class="viewSource">view source</a></div><a name="Time"></a><a name="method-Time"></a><a href="Ext.chart.axis.Time.html#" rel="method-Time" class="cls expand">Time</a> : void</div><div class="description"><div class="short"><p>&nbsp;</p></div><div class="long">
101 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
102 </li></ul></div></div></div><div id="method-drawAxis" class="member inherited"><a href="Ext.chart.axis.Time.html#method-drawAxis" rel="method-drawAxis" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-method-drawAxis" class="viewSource">view source</a></div><a name="drawAxis"></a><a name="method-drawAxis"></a><a href="Ext.chart.axis.Time.html#" rel="method-drawAxis" class="cls expand">drawAxis</a>(
103 <span class="pre">Object init</span>)
104  : void</div><div class="description"><div class="short"><p>Renders the axis into the screen and updates it's position.</p>
105 </div><div class="long"><p>Renders the axis into the screen and updates it's position.</p>
106 <h3 class="pa">Parameters</h3><ul><li><span class="pre">init</span> : Object<div class="sub-desc">
107 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
108 </li></ul></div></div></div><div id="method-drawGrid" class="member inherited"><a href="Ext.chart.axis.Time.html#method-drawGrid" rel="method-drawGrid" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-method-drawGrid" class="viewSource">view source</a></div><a name="drawGrid"></a><a name="method-drawGrid"></a><a href="Ext.chart.axis.Time.html#" rel="method-drawGrid" class="cls expand">drawGrid</a> : void</div><div class="description"><div class="short"><p>Renders an horizontal and/or vertical grid into the Surface.</p>
109 </div><div class="long"><p>Renders an horizontal and/or vertical grid into the Surface.</p>
110 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
111 </li></ul></div></div></div><div id="method-drawLabel" class="member inherited"><a href="Ext.chart.axis.Time.html#method-drawLabel" rel="method-drawLabel" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-method-drawLabel" class="viewSource">view source</a></div><a name="drawLabel"></a><a name="method-drawLabel"></a><a href="Ext.chart.axis.Time.html#" rel="method-drawLabel" class="cls expand">drawLabel</a> : void</div><div class="description"><div class="short"><p>Renders the labels in the axes.</p>
112 </div><div class="long"><p>Renders the labels in the axes.</p>
113 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
114 </li></ul></div></div></div><div id="method-setTitle" class="member inherited"><a href="Ext.chart.axis.Time.html#method-setTitle" rel="method-setTitle" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.chart.axis.Axis.html" class="definedIn docClass">Ext.chart.axis.Axis</a><br/><a href="../source/Axis.html#Ext-chart.axis.Axis-method-setTitle" class="viewSource">view source</a></div><a name="setTitle"></a><a name="method-setTitle"></a><a href="Ext.chart.axis.Time.html#" rel="method-setTitle" class="cls expand">setTitle</a>(
115 <span class="pre">String title</span>)
116  : void</div><div class="description"><div class="short"><p>Updates the <a href="Ext.chart.axis.Time.html#title" rel="Ext.chart.axis.Time#title" class="docClass">title</a> of this axis.</p>
117 </div><div class="long"><p>Updates the <a href="Ext.chart.axis.Time.html#title" rel="Ext.chart.axis.Time#title" class="docClass">title</a> of this axis.</p>
118 <h3 class="pa">Parameters</h3><ul><li><span class="pre">title</span> : String<div class="sub-desc">
119 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
120 </li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>