I'm working on an application with many bar chart, stacked bar chart, and bar with line chart requests. I'm new to creating these charts and trying to figure out how to format the queries in the series as well as adjust the attributes to display the results nicely.
First question. I have a stacked bar chart where each "stack" represents the count of a type of transaction. I have written the same query in four different series with the a different "WHERE transaction_type = ..." clause.
This appears to work but the x-axis is in month/year which is formatted as MMM-YY such as JAN-15, FEB-16, etc. The problem is that they are ordered alphabetically by default in the chart but I want them to be chronological. As far as my SQL knowledge goes, I think this can be accomplished by multiple items in the ORDER BY clause but it doesn't seem to accept any items which aren't in the SELECT portion.

The order should be something like NOV-15 , DEC-15 , JAN-16 , FEB-16, MAR-16....
Current query (of one series):
SELECT null link,period_name,
count(\*) as MatTrans
FROM transactions
WHERE trans_type = 'MatTrans'
group by period_name
order by period_name
What I tried and resulted in a "failed to parse" message upon saving:
SELECT null link,period_name,
count(\*) as MatTrans
FROM transactions
WHERE trans_type = 'MatTrans'
group by period_name
order by period_year,period_num
Does anyone know how to achieve this? If you could also direct me to a good article about writing queries for series of stacked bar charts/combination line charts etc., that would be great!