From 124b70ffeb1aae29726ece52fee505e728e11a0a Mon Sep 17 00:00:00 2001 From: Wim Rijnders Date: Sat, 22 Oct 2016 12:30:53 +0200 Subject: [PATCH] Undid last commit in a very roundabout way. --- lib/graph3d/Graph3d.js | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/lib/graph3d/Graph3d.js b/lib/graph3d/Graph3d.js index 4e4dc10f..95be0634 100644 --- a/lib/graph3d/Graph3d.js +++ b/lib/graph3d/Graph3d.js @@ -831,25 +831,34 @@ Graph3d.prototype.redraw = function() { this._redrawClear(); this._redrawAxis(); - if (this.style === Graph3d.STYLE.GRID || - this.style === Graph3d.STYLE.SURFACE) { - this._redrawDataGrid(); - } - else if (this.style === Graph3d.STYLE.LINE) { - this._redrawDataLine(); + var pointDrawingMethod = undefined; + switch (this.style) { + case Graph3d.STYLE.BAR: + pointDrawingMethod = Graph3d.prototype._redrawBarGraphPoint; + break; } - else if (this.style === Graph3d.STYLE.BAR) { - // Pass a method reference here - this._redrawDataGraph(Graph3d.prototype._redrawBarGraphPoint); + if (pointDrawingMethod !== undefined) { + // Use generic drawing loop + // Pass the method reference here + this._redrawDataGraph(pointDrawingMethod); + } else { + // Use the old style drawing methods - } else if (this.style === Graph3d.STYLE.BARCOLOR || - this.style === Graph3d.STYLE.BARSIZE) { - this._redrawDataBar(); - } - else { - // style is DOT, DOTLINE, DOTCOLOR, DOTSIZE - this._redrawDataDot(); + if (this.style === Graph3d.STYLE.GRID || + this.style === Graph3d.STYLE.SURFACE) { + this._redrawDataGrid(); + } + else if (this.style === Graph3d.STYLE.LINE) { + this._redrawDataLine(); + } else if (this.style === Graph3d.STYLE.BARCOLOR || + this.style === Graph3d.STYLE.BARSIZE) { + this._redrawDataBar(); + } + else { + // style is DOT, DOTLINE, DOTCOLOR, DOTSIZE + this._redrawDataDot(); + } } this._redrawInfo();