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:
2.- Graph in 12.1.3:
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:
4. Swap Bars in 12.1.3:
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.
If you try “Swapping bars manually”:
You need to do the change manually from the dvt:charDataItem component.
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.
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.
7.- Drilling down an ADF Graph in 12.1.2:
First step was to activate this option in the Behaviour tab for the graph:
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).
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:
And a status based on the other boolean:
Then, dragging my VO in a page as a Graph Bars:
I select the Bars to be EmployeeId (could be any other not null attribute) and change the label to say Total.
Then in the source of Page Definition you specify that instead displaying the EmployeeId you should just count them.
Running your page and get the results:
Swap bars for a better graph:
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:
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.
The workaround I thought was to create a new transient attribute that would actually count how many employees for each threshold.
Now, repeating the chart creation using the new transient attribute
We get the same result than 12.1.2.
Swapping the bars manually again:
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.