|
|
|
@ -153,7 +153,7 @@ describe('c3 chart axis', function () {
|
|
|
|
|
|
|
|
|
|
describe('axis.x.tick.values', function () { |
|
|
|
|
describe('function is provided', function () { |
|
|
|
|
var tickGenerator = function (/*domain*/) { |
|
|
|
|
var tickGenerator = function () { |
|
|
|
|
var values = []; |
|
|
|
|
for (var i = 0; i <= 300; i += 50) { |
|
|
|
|
values.push(i); |
|
|
|
@ -599,7 +599,6 @@ describe('c3 chart axis', function () {
|
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('axis.y.tick.rotate', function () { |
|
|
|
|
|
|
|
|
|
describe('not rotated', function () { |
|
|
|
@ -613,6 +612,7 @@ describe('c3 chart axis', function () {
|
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
axis: { |
|
|
|
|
rotated: true, |
|
|
|
|
y: { |
|
|
|
|
tick: { |
|
|
|
|
rotate: 45 |
|
|
|
@ -630,13 +630,13 @@ describe('c3 chart axis', function () {
|
|
|
|
|
tspan = text.select('tspan'); |
|
|
|
|
expect(text.attr('transform')).toBe('rotate(45)'); |
|
|
|
|
expect(text.attr('y')).toBe('4'); |
|
|
|
|
expect(tspan.attr('dx')).toBe('5.65685424949238'); |
|
|
|
|
expect(tspan.attr('dx')).toBeCloseTo('5.6', 0); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should have automatically calculated y axis width', function () { |
|
|
|
|
var box = chart.internal.main.select('.c3-axis-y').node().getBoundingClientRect(); |
|
|
|
|
expect(box.width).toBeLessThan(25); |
|
|
|
|
expect(box.width).toBeCloseTo(590, 1); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|