opts.valueRange = [-0.01, 0.01];
g.updateOptions(opts);
- assert.deepEqual([-0.01,-0.005,0,0.005],
+ assert.deepEqual([-0.01,-0.005,0,0.005,0.01],
Util.makeNumbers(Util.getYLabels()));
g.setSelection(1);
}
});
assert.deepEqual(["0:X","500:X","1000:X","1500:X","2000:X"], Util.getYLabels());
- assert.deepEqual(["1:X","2:X","3:X"], Util.getXLabels());
+ assert.deepEqual(["1:X","2:X","3:X","4:X"], Util.getXLabels());
});
/*
});
// labelsKMB doesn't apply to the x axis. This value should be different.
- // BUG : https://code.google.com/p/dygraphs/issues/detail?id=488
- assert.deepEqual(["1000","2000","3000"], Util.getXLabels());
+ // BUG : https://github.com/danvk/dygraphs/issues/409
+ assert.deepEqual(["1000","2000","3000","4000"], Util.getXLabels());
assert.deepEqual(["0","500","1000","1500","2000"], Util.getYLabels(1));
assert.deepEqual(["0","500","1K","1.5K","2K"], Util.getYLabels(2));
});
// It is weird that labelsKMG2 does something on the x axis but KMB does not.
// Plus I can't be sure they're doing the same thing as they're done in different
// bits of code.
- // BUG : https://code.google.com/p/dygraphs/issues/detail?id=488
+ // BUG : https://github.com/danvk/dygraphs/issues/409
assert.deepEqual(["1024","2048","3072"], Util.getXLabels());
assert.deepEqual(["0","500","1000","1500","2000"], Util.getYLabels(1));
assert.deepEqual(["0","500","1000","1.46k","1.95k"], Util.getYLabels(2));
});
// sigFigs doesn't apply to the x axis. This value should be different.
// BUG : https://code.google.com/p/dygraphs/issues/detail?id=488
- assert.deepEqual(["1000","2000","3000"], Util.getXLabels());
+ assert.deepEqual(["1000","2000","3000","4000"], Util.getXLabels());
assert.deepEqual(["0.0","5.0e+2","1.0e+3","1.5e+3","2.0e+3"], Util.getYLabels(1));
assert.deepEqual(["0.00000","500.000","1000.00","1500.00","2000.00"], Util.getYLabels(2));
});
assert.deepEqual(["1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4"], Util.getYLabels(2));
// maxNumberWidth is ignored for the x-axis.
- // BUG : https://code.google.com/p/dygraphs/issues/detail?id=488
+ // BUG : https://github.com/danvk/dygraphs/issues/409
g.updateOptions({ axes: { x: { maxNumberWidth: 4 }}});
- assert.deepEqual(["12401","12402","12403"], Util.getXLabels());
+ assert.deepEqual(["12401","12402","12403","12404"], Util.getXLabels());
g.updateOptions({ axes: { x: { maxNumberWidth: 5 }}});
- assert.deepEqual(["12401","12402","12403"], Util.getXLabels());
+ assert.deepEqual(["12401","12402","12403","12404"], Util.getXLabels());
g.updateOptions({ axes: { x: { maxNumberWidth: null }}});
- assert.deepEqual(["12401","12402","12403"], Util.getXLabels());
+ assert.deepEqual(["12401","12402","12403","12404"], Util.getXLabels());
});
// Regression test for https://github.com/danvk/dygraphs/issues/506
y: { ticker: firstLastTicker }
}
});
+
+ assert.deepEqual(['0', '3'], Util.getXLabels());
+ assert.deepEqual(['0', '1.2'], Util.getYLabels());
});
/*
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assert.deepEqual(['0', '1', '2'], getXLabels());
+ assert.deepEqual(['0', '1', '2', '3'], getXLabels());
});
it('testTwoCSV', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assert.deepEqual(['0', '1', '2'], getXLabels());
+ assert.deepEqual(['0', '1', '2', '3'], getXLabels());
g.updateOptions({file: data});
- assert.deepEqual(['0', '1', '2'], getXLabels());
+ assert.deepEqual(['0', '1', '2', '3'], getXLabels());
});
});
y2label: 'Secondary y-axis',
}
);
- assert.deepEqual(["40", "45", "50", "55", "60", "65"], Util.getYLabels("1"));
- assert.deepEqual(["900K","1.1M","1.3M","1.5M","1.7M","1.9M"], Util.getYLabels("2"));
-
+ assert.deepEqual(["40", "45", "50", "55", "60", "65", "70"], Util.getYLabels("1"));
+ assert.deepEqual(["900K","1.1M","1.3M","1.5M","1.7M","1.9M","2.1M"], Util.getYLabels("2"));
+
g.updateOptions(
{
axes: {
}
}
);
- assert.deepEqual(["40", "45", "50", "55", "60", "65", "70", "75"], Util.getYLabels("1"));
- assert.deepEqual(["1M", "1.02M", "1.05M", "1.08M", "1.1M", "1.13M", "1.15M", "1.18M"], Util.getYLabels("2"));
+ assert.deepEqual(["40", "45", "50", "55", "60", "65", "70", "75", "80"], Util.getYLabels("1"));
+ assert.deepEqual(["1M", "1.02M", "1.05M", "1.08M", "1.1M", "1.13M", "1.15M", "1.18M", "1.2M"], Util.getYLabels("2"));
});
it('testDrawPointCallback', function() {