PDA

View Full Version : [CLOSED] Chart time axis displays ticks incorrectly when using a step value



Arho
9 Oct 2013, 2:04 AM
REQUIRED INFORMATION

Ext version tested:

Ext 4.2.1 rev 883

Browser versions tested against:

Chrome

Description:

Trying to display week numbers for dates 7 days apart displays too many ticks when using a step of 7 days.

Steps to reproduce the problem:

See example

The result that was expected:

For x dates 7 days apart x ticks with week number are displayed

The result that occurs instead:

For x dates 7 days apart x+1 ticks with week number are displayed

Test Case:

https://fiddle.sencha.com/#fiddle/sm


Ext.onReady(function () {
var store = Ext.create('Ext.data.Store', {
"fields": [{
"name": "offered",
"useNull": true
}, {
"name": "expected",
"useNull": true
}, {
"name": "ordered",
"useNull": true
}, {
"name": "week",
"useNull": true
}],
"data": [{
"expected": 2890,
"offered": 1843,
"ordered": 1108,
"week": "2013\/10\/09 12:00"
}, {
"expected": 2299,
"offered": 1960,
"ordered": 1396,
"week": "2013\/10\/16 12:00"
}, {
"expected": 2617,
"offered": 1865,
"ordered": 1387,
"week": "2013\/10\/23 12:00"
}, {
"expected": 2630,
"offered": 1879,
"ordered": 1029,
"week": "2013\/10\/30 12:00"
}, {
"expected": 2377,
"offered": 2000,
"ordered": 1289,
"week": "2013\/11\/06 12:00"
}]
});
var chart = Ext.create('Ext.chart.Chart', {
"series": [{
"axis": "left",
"stacked": true,
"type": "column",
"xField": "week",
"yField": ["ordered", "expected", "offered"]
}],
"renderTo": document.body,
"height": 400,
"animate": true,
"store": store,
"width": 600,
"axes": [{
"position": "bottom",
"dateFormat": "W",
"type": "Time",
"step": [Ext.Date.DAY, 7],
"fields": ["week"]
}, {
"position": "left",
"type": "Numeric",
"fields": ["ordered", "expected", "offered"]
}]
});
});
HELPFUL INFORMATION

Screenshot or Video:

46247

Note: when using a step of "one too many" there will be correct number of ticks but the increment is wrong. It simply looks like the calculation of ticks is off by one.

Gary Schlosberg
9 Oct 2013, 9:43 AM
Thanks for the report! I have opened a bug in our bug tracker.