Commits

Chris Leonello committed 58ea7ac

Show axes even if series are hidden if scaleToHiddenSeries set to true.
Have hidden series with no color pull a color from the color pallette to preserve color order when series shown/hidden.

Comments (0)

Files changed (1)

src/jqplot.core.js

         // prop: borderColor
         // color of the border adjacent to the axis.  Defaults to grid border color.
         this.borderColor = null;
-        // minimum and maximum values on the axis.
         // prop: scaleToHiddenSeries
         // True to include hidden series when computing axes bounds and scaling.
         this.scaleToHiddenSeries = false;
+        // minimum and maximum values on the axis.
         this._dataBounds = {min:null, max:null};
         // statistics (min, max, mean) as well as actual data intervals for each series attached to axis.
         // holds collection of {intervals:[], min:, max:, mean: } objects for each series on axis.
         this.data = temp;
 
         // parse the renderer options and apply default colors if not provided
-        if (!this.color && this.show) {
+        // Set color even if not shown, so series don't change colors when other
+        // series on plot shown/hidden.
+        if (!this.color) {
             this.color = plot.colorGenerator.get(this.index);
         }
-        if (!this.negativeColor && this.show) {
+        if (!this.negativeColor) {
             this.negativeColor = plot.negativeColorGenerator.get(this.index);
         }
 
                     temp._xaxis.show = true;
                     temp._yaxis.show = true;
                 }
+                else {
+                    if (temp._xaxis.scaleToHiddenSeries) {
+                        temp._xaxis.show = true;
+                    }
+                    if (temp._yaxis.scaleToHiddenSeries) {
+                        temp._yaxis.show = true;
+                    }
+                }
 
                 // // parse the renderer options and apply default colors if not provided
                 // if (!temp.color && temp.show != false) {