Skip to main content

Switch the Chart between 2D and 3D in Oracle APEX

Here I am giving an example to switch the chart (any charts) between 2D and 3D in Oracle APEX.

Step 1: Create a page.

Step 2: Create chart region (any chart type) and set static id as below,
Fig 1: Chart Region

Fig 2: Set Static ID

Step 3: Create two region buttons as below,
Fig 3: Region Buttons

Step 4: Create a dynamic action to switch between 3D to 2D as below,
Fig 4: Dynamic Action
Event: Click
Selection Type: Button
Button: 2D

True Action: 

1) Execute JavaScript Code

apex.region("confirmedcases").widget().ojChart({styleDefaults: { 'threeDEffect': 'off' }});

Fig 5: Script

Step 5: Create a dynamic action to switch between 2D to 3D as below,
Fig 6: Dynamic Action
Event: Click
Selection Type: Button
Button: 3D

True Action: 

1) Execute JavaScript Code

apex.region("confirmedcases").widget().ojChart({styleDefaults: { 'threeDEffect': 'on' }});

Fig 7: Script

Output: (2D View)

Output: (3D View)
The demo is here

That's it.

Happy APEXing!!!...

Comments