isIsolated = false;
if (drawGapPoints || !prevCanvasX) {
iter.nextIdx_ = i;
- var peek = iter.next();
+ iter.next();
nextCanvasY = iter.hasNext ? iter.peek.canvasy : null;
var isNextCanvasYNullOrNaN = nextCanvasY === null ||
*/
DygraphCanvasRenderer.prototype._renderLineChart = function(opt_seriesName, opt_ctx) {
var ctx = opt_ctx || this.elementContext;
- var errorBars = this.attr_("errorBars") || this.attr_("customBars");
- var fillGraph = this.attr_("fillGraph");
var i;
var sets = this.layout.points;
var setNames = this.layout.setNames;
- var setCount = setNames.length;
var setName;
this.colors = this.dygraph_.colorsMap_;
var color = e.color;
var fillAlpha = g.getOption('fillAlpha', setName);
var stepPlot = g.getOption('stepPlot'); // TODO(danvk): per-series
- var axis = e.axis;
var points = e.points;
var iter = Dygraph.createIterator(points, 0, points.length,
var prevX = NaN;
var prevY = NaN;
var prevYs = [-1, -1];
- var yscale = axis.yscale;
// should be same color as the lines but only 15% opaque.
var rgb = new RGBColorParser(color);
var err_color =
var prevX = NaN;
var prevYs = [-1, -1];
var newYs;
- var yscale = axis.yscale;
// should be same color as the lines but only 15% opaque.
var rgb = new RGBColorParser(color);
var err_color =
"use strict";
/** @typedef {Array.<{v:number, label:string, label_v:(string|undefined)}>} */
-Dygraph.TickList;
+Dygraph.TickList = undefined; // the ' = undefined' keeps jshint happy.
/** @typedef {function(
* number,
* Array.<number>=
* ): Dygraph.TickList}
*/
-Dygraph.Ticker;
-
+Dygraph.Ticker = undefined; // the ' = undefined' keeps jshint happy.
/** @type {Dygraph.Ticker} */
Dygraph.numericLinearTicks = function(a, b, pixels, opts, dygraph, vals) {
// that results in tick marks spaced sufficiently far apart.
// The "mults" array should cover the range 1 .. base^2 to
// adjust for rounding and edge effects.
- var scale, low_val, high_val, nTicks, spacing;
+ var scale, low_val, high_val, spacing;
for (j = 0; j < mults.length; j++) {
scale = base_scale * mults[j];
low_val = Math.floor(a / scale) * scale;
delta = delta || Math.PI * 2 / sides;
ctx.beginPath();
- var first = true;
var initialAngle = rotationRadians;
var angle = initialAngle;
var row = this.findClosestRow(domX);
var boundary = this.getLeftBoundary_();
var rowIdx = row - boundary;
- var sets = this.layout_.points;
var closestPoint, closestSeries;
for (var setIdx = 0; setIdx < this.layout_.datasets.length; ++setIdx) {
var points = this.layout_.points[setIdx];
* @private
*/
Dygraph.prototype.updateSelection_ = function(opt_animFraction) {
- var defaultPrevented = this.cascadeEvents_('select', {
+ /*var defaultPrevented = */
+ this.cascadeEvents_('select', {
selectedX: this.lastx_,
selectedPoints: this.selPoints_
});
* indices are into the axes_ array.
*/
Dygraph.prototype.computeYAxes_ = function() {
-
// Preserve valueWindow settings if they exist, and if the user hasn't
// specified a new valueRange.
- var i, valueWindows, seriesName, axis, index, opts, v;
+ var valueWindows, axis, index, opts, v;
if (this.axes_ !== undefined && this.user_attrs_.hasOwnProperty("valueRange") === false) {
valueWindows = [];
for (index = 0; index < this.axes_.length; index++) {
* MIT-licensed (http://opensource.org/licenses/MIT)
*/
+/*global Dygraph:false */
+
Dygraph.Plugins.Annotations = (function() {
"use strict";
* MIT-licensed (http://opensource.org/licenses/MIT)
*/
+/*global Dygraph:false */
+
Dygraph.Plugins.Axes = (function() {
"use strict";
if (g.getOption('drawYAxis')) {
var w = g.getOption('yAxisLabelWidth') + 2 * g.getOption('axisTickSize');
- var y_axis_rect = e.reserveSpaceLeft(w);
+ e.reserveSpaceLeft(w);
}
if (g.getOption('drawXAxis')) {
} else {
h = g.getOptionForAxis('axisLabelFontSize', 'x') + 2 * g.getOption('axisTickSize');
}
- var x_axis_rect = e.reserveSpaceBottom(h);
+ e.reserveSpaceBottom(h);
}
if (g.numAxes() == 2) {
// TODO(danvk): per-axis setting.
var w = g.getOption('yAxisLabelWidth') + 2 * g.getOption('axisTickSize');
- var y2_axis_rect = e.reserveSpaceRight(w);
+ e.reserveSpaceRight(w);
} else if (g.numAxes() > 2) {
g.error("Only two y-axes are supported at this time. (Trying " +
"to use " + g.numAxes() + ")");
};
axes.prototype.clearChart = function(e) {
- var g = e.dygraph;
this.detachLabels();
};
+/*global Dygraph:false */
+
// Namespace for plugins.
Dygraph.Plugins = {};
* Copyright 2012 Dan Vanderkam (danvdk@gmail.com)
* MIT-licensed (http://opensource.org/licenses/MIT)
*/
+/*global Dygraph:false */
+
Dygraph.Plugins.ChartLabels = (function() {
"use strict";
* Copyright 2012 Dan Vanderkam (danvdk@gmail.com)
* MIT-licensed (http://opensource.org/licenses/MIT)
*/
+/*global Dygraph:false */
Dygraph.Plugins.Grid = (function() {
+/*global Dygraph:false */
+
// This file defines the ordering of the plugins.
//
// The ordering is from most-general to most-specific.
* Copyright 2012 Dan Vanderkam (danvdk@gmail.com)
* MIT-licensed (http://opensource.org/licenses/MIT)
*/
+/*global Dygraph:false */
Dygraph.Plugins.Legend = (function() {
/*
// If no points are selected, we display a default legend. Traditionally,
// this has been blank. But a better default would be a conventional legend,
// which provides essential information for a non-interactive chart.
- var html, sepLines, i, c, dash, strokePattern;
+ var html, sepLines, i, dash, strokePattern;
var labels = g.getLabels();
if (typeof(x) === 'undefined') {
* Copyright 2011 Paul Felix (paul.eric.felix@gmail.com)
* MIT-licensed (http://opensource.org/licenses/MIT)
*/
+/*global Dygraph:false,TouchEvent:false */
/**
* @fileoverview This file contains the RangeSelector plugin used to provide
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+/*global Dygraph:false */
/**
* @fileoverview Plug-in for providing unzoom-on-hover.