FROM THE BLOG

JDeveloper 12.1.3: DVT Visualization Graphs, a step back?

I’ll try not to be too critical about it but… Most of us felt mesmerized and exited about this new version’s release notes where a bunch of new graphs were introduced which is great and we should, we are thankful to JDeveloper’s team for the effort. However, there are few “steps back” that I would like to mention to see if I get a valid response from someone in Oracle. Specifically about Bars Charts (this may apply for the rest of the other graphs as well). 

For this post, I will be showing a graph based on Departments view with a transient attribute to get the totalSalary for that department.

1.- Graph in 12.1.2:

adf_graph_1212_1

adf_graph_1212_2 adf_graph_1212_3

2.- Graph in 12.1.3:

adf_graph_1213_2 adf_graph_1213_3 adf_graph_1213_4

So far there are no differences between 12.1.2 and 12.1.3. Now, lets see the next point which is about swapping bars, useful when wanting to display a colorful graph rather than a monocolor one.

3.- Swap Bars in 12.1.2:

adf_graph_1212_5 adf_graph_1212_4 adf_graph_1212_6

 

4. Swap Bars in 12.1.3:

adf_graph_1213_5

Note that now the graph works with a tree binding… So you have to go to the component itself and click in the pencil icon to launch the wizard but as you can see, there is no button to swap bar.

adf_graph_1213_6

If you try “Swapping bars manually”:

adf_graph_1213_7

 

You need to do the change manually from the dvt:charDataItem component.

 

 

 

 

 

adf_graph_1213_8 adf_graph_1213_9

And because not all is bad, there is this nice new feature that allows you to kind of scroll if there are too many items.

adf_graph_1213_10

 

Please also note that you could use the Color attribute and implement some logic in your ViewObject to drive the color for your bars… It’s not clear if this is what we are supposed to do now.

adf_graph_1213_12

 

7.- Drilling down an ADF Graph in 12.1.2:

First step was to activate this option in the Behaviour tab for the graph:

adf_graph_1212_7

Please refer to one of my previous post here.

8.- Drilling down an ADF Graph in 12.1.3:

There is no such a thing as DrillingEnabled and furthermore, the bindings won’t allow you to drill down the graph as you used to do it (it is a simple tree rather than the graph component).

adf_graph_1213_11

9.- Aggregate functions in ADF Graph 12.1.2:

This is the latest point but in my opinion, the most important piece. Lets say that we want to display in a graph, how many employees fall into a stablished wage, less than 5K, between 5K and 10K, 10K and 20K and more than 20K. To do this, I would normally go to my ViewObject and implement something like this:

Create my boolean to determine where an employee belongs to:

adf_graph_1212_9

And a status based on the other boolean:

adf_graph_1212_10

 

Then, dragging my VO in a page as a Graph Bars:

adf_graph_1212_11

I select the Bars to be EmployeeId (could be any other not null attribute) and change the label to say Total.

adf_graph_1212_12

Then in the source of Page Definition you specify that instead displaying the EmployeeId you should just count them.

adf_graph_1212_13

Running your page and get the results:

adf_graph_1212_14

Swap bars for a better graph:

adf_graph_1212_15 adf_graph_1212_16

 

10.- Aggregate Functions in ADF Graphs 12.1.3

After implementing the same logic in the ViewObject, we proceed and try to imitate what we did in 12.1.2:

adf_graph_1213_13

But again, because there is a tree binding instead the graph binding we can’t actually specify that we need to count the employeeId. If we run the page we find out that the framework is SUMming them by default. Where to change this? I could not find.

adf_graph_1213_14

 

The workaround I thought was to create a new transient attribute that would actually count how many employees for each threshold.

adf_graph_1213_22

 

Now, repeating the chart creation using the new transient attribute

adf_graph_1213_23

We get the same result than 12.1.2.

adf_graph_1213_24

 

Swapping the bars manually again:

adf_graph_1213_25

adf_graph_1213_26

 

If anyone knows what am I missing please do not hesitate and let me know. Otherwise, I guess we will need to wait for Oracle and the team to see what went on with these graphs.

2 comments

  1. Katarina Obradovic-Sarkic

    on

    Reply

    While we understand the inconvenience that some features that were available in the old Graph are now achieved in a different way, we want to point out that the benefits of the new solution far outweigh any migration issues.
    The new Charts offer a number of benefits over the old Graph, such as:

    1. Client Side Resizing: Ability to resize and fit to containers without the need to go back to the server for layout.
    2. Improved Server Scalability: Layout is offloaded to the client, reducing server workload and increasing scalability of applications.
    3. Consistency: Same set of visualizations used in ADF and Mobile Application Framework
    4. Rich Set of Features:
    Redesigned zoom and scroll
    Marquee zoom and selection
    Redesigned Time axis
    Improved data labeling
    Support for “other” slice to aggregate small values in Pie charts
    Support for sorting in Pie charts

    The fact that the new Charts now use a standard tree binding instead of a custom Graph binding has many benefits:

    1. Using the standard tree binding lets the user easily convert a table to a chart and vice versa
    2. All the view components share a common selection API in the RowKeySet
    3. Because of the standard binding, the new Charts have a more flexible tag structure that supports a standard stamping pattern

    To achieve the feature where each bar is colored differently even though they all belong to the first series, we recommend to use attribute groups to specify that the bars should be colored by group.

    To to this, you would insert the following code into the tag, instead of swapping the series and group bindings:

    I believe that in your example it would be the following:

    If you use this new feature, then the bars would still be nicely spaced and display the labels below as in the original Chart, but would be colored differently as desired.

    This feature and other new Chart formatting features are described in this video:
    http://download.oracle.com/otn_hosted_doc/jdeveloper/12cdemos/DVTChartsFormatting/DVTChartsFormatting.html

    Thanks,
    Katia

  2. Katarina Obradovic-Sarkic

    on

    Reply

    Not sure why the code is not displaying here, but I also posted it to your OTN thread here:
    https://community.oracle.com/thread/3597261, as well as how to achieve master-detail row selection with the new Charts.

Leave a comment

Your email address will not be published.

Social Media

Stay up-to-date with our latest ADF and related technical posts via your favourite social network services.