Date post: | 12-Jan-2016 |
Category: |
Documents |
Upload: | robyn-powers |
View: | 226 times |
Download: | 0 times |
2
APEX ChartsPablo del Castro Galán GS-ASE-EDS
2014/05/06 EDMS Doc. 1377932
EDMS
EDMS Doc. 1377932 3
Charts in APEX• Since the version 3.0 (2007) graphic capabilities
have been included in Oracle Application Express (APEX) using AnyChart engine 3.0, from APEX 4.x AnyChart engine 5.0 is used
• Anychart is a 3rd party product embedded in APEX (http://www.anychart.com)
2014/05/06
EDMS Doc. 1377932 4
Chart Types•
2014/05/06
EDMS Doc. 1377932 5
Chart Features• Custom Legends• Save chart as Image• Interactivity options
(hoverable, selectable data point, drill down …)
• And many more features
2014/05/06
• Custom labels • Custom tooltips• Custom colours• Custom data point
attributes• Multiple Axis• Axis Inversion• Axis Positioning• Logarithmic Scales• Date time Scale
EDMS Doc. 1377932 6
Charts in Flash and HTML5• Anychart can generate charts either in Flash
or JavaScript (HTML5)• Easy to change between the two.
• Some old browsers do not know HTLM5 (external frames embedded in INFOR EAM)
• Some devices or browsers do not manage Flash
2014/05/06
EDMS Doc. 1377932 7
APEX Wizard (I)• Create Page Chart
2014/05/06
EDMS Doc. 1377932 8
APEX Wizard (II)•
2014/05/06
EDMS Doc. 1377932 9
APEX Wizard (III)•
2014/05/06
EDMS Doc. 1377932 10
Chart Attributes (I)
2014/05/06
EDMS Doc. 1377932 11
Chart Attributes (II)
2014/05/06
EDMS Doc. 1377932 12
Chart Attributes (III)
2014/05/06
EDMS Doc. 1377932 13
Chart Series
2014/05/06
EDMS Doc. 1377932 14
XML Interface (I)• AnyChart is driven by XML interface.• AnyChart engine processes the content in
the XML and generate the chart. • This XML can be generated using whatever
language, however APEX offers a wizard and its own interface.
• All graphing happens on the client side, no rendering on the server side
2014/05/06
EDMS Doc. 1377932 15
XML Interface (II)
2014/05/06
No DATA message, animation, fonts
http://www.anychart.com/products/anychart/docs/xmlReference/index.html
Titles, labels, legend, grids …
Style, effects, tooltips ..
#DATA#
Extra labels Oops, how to insert new nodes here ?
EDMS Doc. 1377932 16
Generating your own #DATA# (I)
2014/05/06
1. Delete the #DATA# tag in XML and replace it by our own hidden item
2. Create a computation that would write the new XML in our item
3. Write the code in PL/SQL which generates the proper XML
EDMS Doc. 1377932 17
Generating your own #DATA# (II)
2014/05/06
The sum of the category on the top of the bar
EDMS Doc. 1377932 18
Drill Down• The first column of the query for an Chart is
called LINK (APEX URL). It has to exist
2014/05/06
Current Application ID Current Session ID ParametersPage
'f?p='|| :APP_ID ||':1315:'|| :APP_SESSION ||'::::P1315_SECTION_LEADER,P1315_OBJ_OBTYPE,P1315_OBJ_CLASS:&P1310_SECTION_LEADER.,P,SFRIA',
Parameters’ NamesParameters’ Values
EDMS Doc. 1377932 19
Pivot and Unpivot Operators• The pivot and unpivot operators are new in
Oracle 11 G and they are widely used for reports and BI
• A pivot query is meant to transpose rows into columns while the unpivot sentence does the opposite, transpose columns into rows.
2014/05/06
EDMS Doc. 1377932 20
Pivoted TableFormat needed for a bar stacked chart
Pivot Operator
2014/05/06
SELECT ... FROM ... PIVOT [XML]
WHERE …
defines the columns to be aggregated (pivot is an aggregate operation)
defines the columns to be grouped and pivoted
defines the filter for the column(s) in the pivot_for_clause
Original Table
(SUM (NUM) FOR EVT_TYPE IN (‘JOB’, ‘PPM’) )
( pivot_clause pivot_for_clause pivot_in_clause )
EDMS Doc. 1377932 21
Unpivot Operator
2014/05/06
SELECT ... FROM ... UNPIVOT [INCLUDE| EXCLUDE NULLS]
WHERE …
( unpivot_clause unpivot_for_clause unpivot_in_clause )
the list of pivoted columns (not values) to be unpivoted.
( VALUE FOR LABEL IN (WO_WITH ,WO_WITHOUT ))
a column name column to represent the unpivoted valuesthe name for the column that will result from our unpivot query
Original TableUnpivoted Table
Format needed for a pie chart
EDMS Doc. 1377932 22
Running Totals• Analytic Function (arguments) • OVER ( [PARTITION_BY_CLAUSE] [ORDER_BY_CLAUSE] )
2014/05/06
SELECTSUM (DECODE (NUM, NULL, 0, NUM)) OVER (ORDER BY FECHA) AS REALISEFROM TABLE
EDMS Doc. 1377932 23
EAM Light Dashboard
2014/05/06
EDMS Doc. 1377932 24
Fire Brigade Dashboard (I)•
2014/05/06
EDMS Doc. 1377932 25
Fire Brigade Dashboard (II)•
2014/05/06