Charts - Custom Sort Sequence

i have prepared a report based on the following view:

SELECT EXTRACT(MONTH FROM orders_date),
MONTHNAME(STR_TO_DATE(EXTRACT(MONTH FROM orders_date),‘%m’)) monthnumber,
sum(orders.orders_sigtotal)
FROM orders GROUP BY EXTRACT(YEAR_MONTH FROM orders_date)
order by EXTRACT(MONTH FROM orders_date) asc limit 12

report is displaying fine, like:

1 Jan 200,000
2 Feb 130,000
3 March 400,000
4 April 50,000

but in chart the month values are not sorting out, like:

April Feb January March

Note: i did not selected Chart’s Sort Type option. But even if i select X ASC or X Desc,
it does’nt effect the chart sort, they remains April, Feb, January, March or March, January, February, April.

How could i use Custom Sort Sequence ? What i will right in that column ?

or how could i change it manually ?

Please help

You may enter your own sort sequence (X value should be monthnumber in your view, which is actually monthname, not by the month), see the topic Chart Setup → Custom sort sequence in the help file. (No need to order by EXTRACT(MONTH FROM orders_date) although it doesn’t affect the custom sort.)

I also have the exact same problem… whatever I put in “Custom sort sequence” I always get the exact alphabetical order of labels.

Amer wrote:

whatever I put in “Custom sort sequence” I always get the exact alphabetical order of labels.

What did you enter?

From the help file:

you can enter your custom order by: (no spaces after commas)

label1,label2,label3,…

If the labels contain comma, you can enter an array, e.g. [“label1”, “label2”, “label3”, …]

what u mean by label1. Will i directly type label1 word in this field ?

They are the values of your X axis, e.g. Jan,Feb,Mar,…

I tried but charts are considering the month as alphabet letters and producing the same result as:

April, Feb, Jan, Mar

What did you enter?

I have tried these possibilities (with no spaces in between them):

Delayed Tasks,Active Tasks,Completed,Canceled,Archived

“Delayed Tasks”,“Active Tasks”,“Completed”,“Canceled”,“Archived”

[“Delayed Tasks”,“Active Tasks”,“Completed”,“Canceled”,“Archived”]

with no success… it always shows in alphabetical order (the last one with the will give an error and will not run).

Thank you

From the help file, the first and the third should be correct.

Amer wrote:

(the last one with the will give an error and will not run).

What error?

From the help file, the first and the third should be correct.

Forget about the third and its error, the first one (which should work as mentioned in the help file) never worked for me, whatever I select in the “Sort type” field.

Amer wrote:

Forget about the third and its error, the first one (which should work as mentioned in the help file) never worked for me, whatever I select in the “Sort type” field.

Why not the third type? It is actually better. From the source code:

if (is_array($seq))
$ar = $seq;
else
$ar = explode(“,”, $seq);

If it is not already an array, it just explode it to get one. So they are the same, and the third type saves a step.

Make sure:

  • You choose either X ASC or X DESC
  • Your custom sort sequence is from the X axis and they must be the same as what you see in the chart (including letter case)
  • If you use the first type, make sure there is no spaces before or after the comma

ok, I will,
thank you for your help.