Oracle Apex: Opening a modal dialogue from a chart, passing multiple values

 Requirement

You want to open a dialogue to display further info for a chart, but you want to pass multiple values from the chart. It could be any chart - bar, pie etc.

Solution

Add a new column to your chart query, joining the values that you want to pass with something safe. I used pipe.

Create a pop-up region in your page. Template needs to be "Inline Dialog". Give it a unique Static ID.

Create an item to receive your parameters. I called mine P1500_POP_UP_PARAM.

Now in the link properties of your chart, pass the values from your chart query to your waiting item.

Create a dynamic on-change action for your parameter item which you will use to display the pop-up region.

This is the JS code (Note the static ID):

openModal('ORDERSNOTFIN');

That's it. Your pop-up will render when clicking on the graph, passing information about what you have clicked.

Now that you have the information that you need and can see it working, hide your parameter item and work on your pop-up. Mine will be a small report showing more details for the chart area clicked.


Comments