Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Make a Line Chart based on Fiscal Year?

DannyS-OracleJul 22 2016 — edited Jul 26 2016

Hi guys,

I encountered a problem when trying to make a chart like this:

image014.png

I have tried using both Flot Line Chart and D3 Line Chart, and looking at the example from the Sample Charts in Apex packaged apps:

Screen Shot 2016-07-22 at 4.36.08 PM.png

so based on the example above (figure 2), the chart is displaying the x-axis by date (full mm/dd/yyy). What I want (figure 1) is displaying per month only, based on fiscal year (Jun to May). But it seems my query does not want to work if it is not DATE type? Here is my query:

SELECT

EXTRACT(MONTH FROM Activity\_Date) "Month",

COUNT(\*) "Number of Activities"

FROM

Activity a

WHERE

(

(Activity\_Date BETWEEN 

     TO\_DATE( :P1\_YEARS-1 || '/06/01', 'yyyy/mm/dd' ) AND 

     TO\_DATE( :P1\_YEARS || '/05/31', 'yyyy/mm/dd' ) )

)

GROUP BY

EXTRACT(MONTH FROM Activity\_Date)

Upon selection of x-value, I set the type as NUMBER and the "Month" column as value. But the chart does not appear and displaying weird number at axis:

Screen Shot 2016-07-22 at 4.52.54 PM.png

Setting the month as varchar2 (e.g. to_char(Activity_Date, 'Mon')) will make the x-value not accepted (only DATE, TIMESTAMP, and NUMBER accepted).

Screen Shot 2016-07-22 at 4.59.04 PM.png

Does this mean the chart can only work if the x-value is of DATE type? Is it possible to force the Extracted Month in the query as DATE type? Or do I miss something here? Any help will be appreciated!

I am using Apex v5.0.3.

Danny

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2016
Added on Jul 22 2016
6 comments
911 views