Skip to content
Browse files

Fix for axis ranges between 0 and 1

  • Loading branch information...
1 parent 1ba3524 commit aa9a0178d41095235587aa30d5532aa8026cf8df Martin Kleppmann committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 PlotKit/Layout.js
View
4 PlotKit/Layout.js
@@ -535,7 +535,7 @@ PlotKit.Layout.prototype._evaluatePieCharts = function() {
PlotKit.Layout.prototype._getBestScale = function(minValue, maxValue, numTicks) {
// The spacings which we want to allow. For example, a spacing of 3 could produce a list
// of ticks like 0, 300, 600, 900, 1200, 1500.
- var spacings = [1, 2, 3, 4, 5];
+ var spacings = [1, 2, 2.5, 3, 4, 5];
var minTicks = 5; var maxTicks = 8; // defaults if nothing else is set
if (MochiKit.Base.isArrayLike(numTicks)) {
@@ -568,7 +568,7 @@ PlotKit.Layout.prototype._getBestScale = function(minValue, maxValue, numTicks)
while (thisRange < valueRange) {
thisRange *= 10;
}
- while (thisRange > valueRange*10) {
+ while (thisRange >= valueRange*10) {
thisRange /= 10;
}

0 comments on commit aa9a017

Please sign in to comment.
Something went wrong with that request. Please try again.