};
DateTickerTestCase.prototype.testBasicDateTicker = function() {
- var opts = {labelsDateUTC: true};
+ var opts = {labelsUTC: true};
var options = this.createOptionsViewForAxis('x', opts);
var ticks = Dygraph.dateTicker(-1797534000000, 1255579200000, 800, options);
};
DateTickerTestCase.prototype.testAllDateTickers = function() {
- var opts = {labelsDateUTC: true};
+ var opts = {labelsUTC: true};
var options = this.createOptionsViewForAxis('x', opts);
// For granularities finer than MONTHLY, the first tick returned tick
"type": "boolean",
"description": "When set, display the graph as a step plot instead of a line plot. This option may either be set for the whole graph or for single series."
},
- "labelsDateUTC": {
+ "labelsUTC": {
"default": "false",
- "labels": ["Value display/formatting"],
+ "labels": ["Value display/formatting", "Axis display"],
"type": "boolean",
"description": "Show date/time labels according to UTC (instead of local time)."
},
Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
var formatter = /** @type{AxisLabelFormatter} */(
opts("axisLabelFormatter"));
- var utc = opts("labelsDateUTC");
+ var utc = opts("labelsUTC");
var accessors = utc ? Dygraph.DateAccessorsUTC : Dygraph.DateAccessorsLocal;
var datefield = Dygraph.TICK_PLACEMENT[granularity].datefield;
/**
* Convert a JS date to a string appropriate to display on an axis that
* is displaying values at the stated granularity. This respects the
- * labelsDateUTC option.
+ * labelsUTC option.
* @param {Date} date The date to format
* @param {number} granularity One of the Dygraph granularity constants
* @param {Dygraph} opts An options view
* @private
*/
Dygraph.dateAxisLabelFormatter = function(date, granularity, opts) {
- var utc = opts('labelsDateUTC');
+ var utc = opts('labelsUTC');
var accessors = utc ? Dygraph.DateAccessorsUTC : Dygraph.DateAccessorsLocal;
var year = accessors.getFullYear(date),
/**
* Return a string version of a JS date for a value label. This respects the
- * labelsDateUTC option.
+ * labelsUTC option.
* @param {Date} date The date to be formatted
* @param {Dygraph} opts An options view
* @private
*/
Dygraph.dateValueFormatter = function(d, opts) {
- return Dygraph.dateString_(d, opts('labelsDateUTC'));
+ return Dygraph.dateString_(d, opts('labelsUTC'));
};
/**
<h2>UTC date and time labels</h2>
<p>This shows how date ticks and labels may be generated according to local
- time (default) or UTC with the option <code>labelsDateUTC</code>.</p>
+ time (default) or UTC with the option <code>labelsUTC</code>.</p>
<p>72 hours of random hourly data since 2009-Jul-23 18:00 UTC
according to local time (top) and UTC (bottom):</p>
document.getElementById("div_utc"),
data,
{
- labelsDateUTC: true,
+ labelsUTC: true,
labels: ['UTC', 'random']
}
);