PDA

View Full Version : Chart Time Axis not scaling correctly



aseitler
2 Mar 2012, 11:33 AM
I've been working with the charting library for a while now trying to figure out how to get the time axis to scale with the marks at the 1st of each month. The following is the code for my time axis:


{
type: 'Time',
position: 'bottom',
fields: ['date'],
dateFormat: 'M \'y',
groupBy: 'year, month',
step: [Ext.Date.MONTH, 1],


fromDate: minDate,
toDate: maxDate
}


where minDate is the first day of the month a year ago and max date is the first of the next month from the current date. I thought the step property would guarantee that it would step from, say March 1st to April 1st to May 1st, etc. Any thoughts on this would be appreciated!

Also, the time is stored as a numerical timestamp if that has any bearing on an answer.

I'm using ExtJS 4.0.7

mitchellsimoens
2 Mar 2012, 11:45 AM
To be honest, I have had issues with the time axis in 4.x

aseitler
2 Mar 2012, 1:50 PM
What sort of problems have you had and have you found a solution? I really need to get this to work and I'm not finding any way around it. I'm pretty sure I know exactly why the scaling is off based on what the time axis code is trying to do, but I don't know a workaround.

bluezz
1 Jun 2012, 4:34 AM
I would love to know if there's a work around for this too.
Most of the charts have time as one of their axis so this bug makes extjs charts pretty unusable!

Charlyva
21 Jun 2012, 1:08 AM
I would love to use time axis too, but this bug is kind of a dealbreaker for using the extjs charts. Almost EVERY chart hast a time component, very often scaled in monthly or yearly steps. Looks like the time axis cannot deal with the various length of different months. For the moment it seems the only choice is to switch to the highcharts library for the time being.

Please, please get things straight with the time axis. I would rather go with an homogen extjs solution than mix various js-frameworks.

thanks in advance.
Mike

gameboy87
20 Jul 2012, 4:13 AM
May I know how you took the minDate and maxDate ? I was able to pick up the values from inside the store's load event. But outside the store I was not able to do it. Please help on this.



I've been working with the charting library for a while now trying to figure out how to get the time axis to scale with the marks at the 1st of each month. The following is the code for my time axis:


{
type: 'Time',
position: 'bottom',
fields: ['date'],
dateFormat: 'M \'y',
groupBy: 'year, month',
step: [Ext.Date.MONTH, 1],


fromDate: minDate,
toDate: maxDate
}


where minDate is the first day of the month a year ago and max date is the first of the next month from the current date. I thought the step property would guarantee that it would step from, say March 1st to April 1st to May 1st, etc. Any thoughts on this would be appreciated!

Also, the time is stored as a numerical timestamp if that has any bearing on an answer.

I'm using ExtJS 4.0.7

gmartin
21 Oct 2015, 1:19 PM
Has there been any movement on this issue? I'm using 5.1 and it seems the layout for axis.Time is very rudimentary and not impacted by the step configuration. The version of calculateMajorTicks being called is the default from Ext.chart.axis.layout.LayoutView and the context.majorTicks object gets set to step = 14 and steps = 51. This is not the most useful display. I think that users expectations are that time breaks on months when seen over a years course, not on fortnights.