PDA

View Full Version : Grid: Step unit for month?



nickd123
30 Sep 2016, 11:57 AM
Hi all,

I'm trying to change the interval on the axes of a grid so that it steps by month. The code I'm working with looks like this (important part in red):


type: 'time', position: 'bottom',
dateFormat:'F-Y',
fields: ['fieldName'],
segmenter: {
type: 'time',
step: {
unit: 'd', // D is in there as a placeholder. I want months!
step: 1
}
},
label: {
rotate: {
degrees: 315
}
}

I've found that, for the unit property, d = day and y = year, but I can't find the proper unit for the month. I've tried both m and f, uppercase and lower.

Does anybody know how to step the grid by month without having to write custom code?

Thanks!

Gary Schlosberg
30 Sep 2016, 3:09 PM
I don't see a segmenter config a chart axis in Ext JS. Is this a Sencha Touch chart?

01061991
12 Oct 2017, 9:54 PM
Hi all,

I'm trying to change the interval on the axes of a grid so that it steps by month. The code I'm working with looks like this (important part in red):


type: 'time', position: 'bottom',
dateFormat:'F-Y',
fields: ['fieldName'],
segmenter: {
type: 'time',
step: {
unit: 'd', // D is in there as a placeholder. I want months!
step: 1
}
},
label: {
rotate: {
degrees: 315
}
}

I've found that, for the unit property, d = day and y = year, but I can't find the proper unit for the month. I've tried both m and f, uppercase and lower.

Does anybody know how to step the grid by month without having to write custom code?

Thanks!



use 'mo' as unit for month ,
segmenter: {
type: 'time',
step: {
unit: 'mo',
step: 1
}
}