projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sync in the massive r48
[dygraphs.git]
/
dygraph-canvas.js
diff --git
a/dygraph-canvas.js
b/dygraph-canvas.js
index
04e1eb1
..
e03c840
100644
(file)
--- a/
dygraph-canvas.js
+++ b/
dygraph-canvas.js
@@
-3,7
+3,7
@@
/**
* @fileoverview Subclasses various parts of PlotKit to meet the additional
/**
* @fileoverview Subclasses various parts of PlotKit to meet the additional
- * needs of D
ateG
raph: grid overlays and error bars
+ * needs of D
yg
raph: grid overlays and error bars
*/
// Subclass PlotKit.Layout to add:
*/
// Subclass PlotKit.Layout to add:
@@
-11,21
+11,21
@@
// 2. Copy error terms for PlotKit.CanvasRenderer._renderLineChart
/**
// 2. Copy error terms for PlotKit.CanvasRenderer._renderLineChart
/**
- * Creates a new D
ateG
raphLayout object. Options are the same as those allowed
+ * Creates a new D
yg
raphLayout object. Options are the same as those allowed
* by the PlotKit.Layout constructor.
* @param {Object} options Options for PlotKit.Layout
* by the PlotKit.Layout constructor.
* @param {Object} options Options for PlotKit.Layout
- * @return {Object} The D
ateG
raphLayout object
+ * @return {Object} The D
yg
raphLayout object
*/
*/
-D
ateG
raphLayout = function(options) {
+D
yg
raphLayout = function(options) {
PlotKit.Layout.call(this, "line", options);
};
PlotKit.Layout.call(this, "line", options);
};
-D
ateG
raphLayout.prototype = new PlotKit.Layout();
+D
yg
raphLayout.prototype = new PlotKit.Layout();
/**
* Behaves the same way as PlotKit.Layout, but also copies the errors
* @private
*/
/**
* Behaves the same way as PlotKit.Layout, but also copies the errors
* @private
*/
-D
ateG
raphLayout.prototype.evaluateWithError = function() {
+D
yg
raphLayout.prototype.evaluateWithError = function() {
this.evaluate();
if (!this.options.errorBars) return;
this.evaluate();
if (!this.options.errorBars) return;
@@
-52,7
+52,7
@@
DateGraphLayout.prototype.evaluateWithError = function() {
/**
* Convenience function to remove all the data sets from a graph
*/
/**
* Convenience function to remove all the data sets from a graph
*/
-D
ateG
raphLayout.prototype.removeAllDatasets = function() {
+D
yg
raphLayout.prototype.removeAllDatasets = function() {
delete this.datasets;
this.datasets = new Array();
};
delete this.datasets;
this.datasets = new Array();
};
@@
-61,7
+61,7
@@
DateGraphLayout.prototype.removeAllDatasets = function() {
* Change the values of various layout options
* @param {Object} new_options an associative array of new properties
*/
* Change the values of various layout options
* @param {Object} new_options an associative array of new properties
*/
-D
ateG
raphLayout.prototype.updateOptions = function(new_options) {
+D
yg
raphLayout.prototype.updateOptions = function(new_options) {
MochiKit.Base.update(this.options, new_options ? new_options : {});
};
MochiKit.Base.update(this.options, new_options ? new_options : {});
};
@@
-72,10
+72,10
@@
DateGraphLayout.prototype.updateOptions = function(new_options) {
/**
* Sets some PlotKit.CanvasRenderer options
* @param {Object} element The canvas to attach to
/**
* Sets some PlotKit.CanvasRenderer options
* @param {Object} element The canvas to attach to
- * @param {Layout} layout The D
ateG
raphLayout object for this graph.
+ * @param {Layout} layout The D
yg
raphLayout object for this graph.
* @param {Object} options Options to pass on to CanvasRenderer
*/
* @param {Object} options Options to pass on to CanvasRenderer
*/
-D
ateG
raphCanvasRenderer = function(element, layout, options) {
+D
yg
raphCanvasRenderer = function(element, layout, options) {
PlotKit.CanvasRenderer.call(this, element, layout, options);
this.options.shouldFill = false;
this.options.shouldStroke = true;
PlotKit.CanvasRenderer.call(this, element, layout, options);
this.options.shouldFill = false;
this.options.shouldStroke = true;
@@
-87,17
+87,12
@@
DateGraphCanvasRenderer = function(element, layout, options) {
// TODO(danvk) This shouldn't be necessary: effects should be overlaid
this.options.drawBackground = false;
};
// TODO(danvk) This shouldn't be necessary: effects should be overlaid
this.options.drawBackground = false;
};
-D
ateG
raphCanvasRenderer.prototype = new PlotKit.CanvasRenderer();
+D
yg
raphCanvasRenderer.prototype = new PlotKit.CanvasRenderer();
/**
* Draw an X/Y grid on top of the existing plot
*/
/**
* Draw an X/Y grid on top of the existing plot
*/
-DateGraphCanvasRenderer.prototype.render = function() {
- // Do the ordinary rendering, as before
- // TODO(danvk) Call super.render()
- this._renderLineChart();
- this._renderLineAxis();
-
+DygraphCanvasRenderer.prototype.render = function() {
// Draw the new X/Y grid
var ctx = this.element.getContext("2d");
if (this.options.drawYGrid) {
// Draw the new X/Y grid
var ctx = this.element.getContext("2d");
if (this.options.drawYGrid) {
@@
-131,12
+126,17
@@
DateGraphCanvasRenderer.prototype.render = function() {
ctx.stroke();
}
}
ctx.stroke();
}
}
+
+ // Do the ordinary rendering, as before
+ // TODO(danvk) Call super.render()
+ this._renderLineChart();
+ this._renderLineAxis();
};
/**
* Overrides the CanvasRenderer method to draw error bars
*/
};
/**
* Overrides the CanvasRenderer method to draw error bars
*/
-D
ateG
raphCanvasRenderer.prototype._renderLineChart = function() {
+D
yg
raphCanvasRenderer.prototype._renderLineChart = function() {
var context = this.element.getContext("2d");
var colorCount = this.options.colorScheme.length;
var colorScheme = this.options.colorScheme;
var context = this.element.getContext("2d");
var colorCount = this.options.colorScheme.length;
var colorScheme = this.options.colorScheme;