Sorting problem ... really annoying

I face the same problem on regular basis with this tool which is really annoying (that a simple problem Excel can resolve in 5 seconds).

I have a list order very simply:

Serial number, Month, identifier, Category
1, jan-16, A1,telephone
2, Jan-16, A2, telephone
3, Feb-16, A3, Mobile
4, Feb-16, A4, telephone
5, Mar-16, A5, Mobile
6, Mar-16, A6, telephone

You get the idea.

When I plot a chat with vertical bar, with a count on identifier per month, no worries

JAN - Feb - Mar … You got the idea

When I add a aggregation on the chart with category, while the values are correct, the order of the month is messed up !

May - July - June - April - …

Why ?
Just don’t get it, why the tool doesn’t have a drop down with a sort filter and over !

Very tired of that. How do i solve this guys !

Can someone from Plumsail provide a response please?

Please, read the following thread:
[url]Need to sort the data based on Month]

thanks Dmitry, but I've tried this post.
It doesn't work.

[code]var handlers = {};
handlers.preRender = function(config, logger) {
logger.debug('Configuration: ', config);
window.config = config;
var ordering = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

Array.prototype.sort.call(config.series, function(a, b) {
return ordering.indexOf(a.data[0].month) - ordering.indexOf(b.data[0].month);
});

return true;
}[/code]

I have a calculated field:
t_month (text month) containing Jan; Feb...
num_of_month (num month) containing 1,2,3 ...

and the source field with:
Month: Jan-16, Feb-16 ...

Result is the same:

and before you jump on it. I have tried below combinaison:

[quote]var handlers = {};
handlers.preRender = function(config, logger) {
logger.debug('Configuration: ', config);
window.config = config;
var ordering = [‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘10’, ‘11’, ‘12’];

Array.prototype.sort.call(config.series, function(a, b) {
return ordering.indexOf(a.data[0].month) - ordering.indexOf(b.data[0].month);
});

return true;
}[/quote]

[quote]var handlers = {};
handlers.preRender = function(config, logger) {
logger.debug('Configuration: ', config);
window.config = config;
var ordering = [‘Jan-16’, ‘Feb’, ‘Mar-16’, ‘Apr-16’, ‘May-16’, ‘Jun-16’, ‘Jul-16’, ‘Aug-16’, ‘Sep-16’, ‘Oc-16’, ‘Nov-16’, ‘Dec-16’];

Array.prototype.sort.call(config.series, function(a, b) {
return ordering.indexOf(a.data[0].month) - ordering.indexOf(b.data[0].month);
});

return true;
}[/quote]

Could you send a template of the list with data and configuration of the chart to support@spchart.com?

sent, let’s see how we are progressing.
I will update the forum later as it can help somebody else.

Alexis

The answer was:

[code]var handlers = {};
handlers.preRender = function(config, logger) {
logger.debug('Configuration: ', config);

var ordering = ['Jan 2016', 'Feb 2016', 'Mar 2016', 'Apr 2016', 'May 2016', 'Jun 2016', 'Jul 2016', 'Aug 2016', 'Sep 2016', 'Oct 2016', 'Nov 2016', 'Dec 2016'];

for (var i = 0; i < config.series.length; i++) {
for (var orderingIndex = (new Date()).getMonth(); orderingIndex >= 0; orderingIndex–) {
config.series[i].data.unshift({Month: ordering[orderingIndex], weight: 0});
};
};

window.config = config;

return true;

}[/code]

Case close, thanks everyone.