Legends using Page Item in Oracle APEX


This blogs explains, how to show page items as legends in Oracle APEX. 

Follow the below steps to create a legend

1) Create an Item.

2) Change the Item Type to Display Only.

3) Provide a value to the item (Source -> Type -> Select any type as per the requirement). 

4) Paste the below code in the Label section.

<svg class="legend-svg"><rect class="legend-rect legend-1"></rect></svg>

5) Paste the below code in the CSS - > Inline section of the page.

.legend-svg {
    height: 30px;
    width: 40px;
}
.legend-rect {
    stroke-width: 3;
    stroke: rgb(0,0,0);
    height: 20px;
    width: 40px;
}  
.legend-1 {
    fill:#E38211; /*color of the legend*/
}

Note: The above CSSLayout and Appearance of the item can be modified as per the requirement. 

6) Save and Run the page


Please see the How to.. section in the demo for better understanding.


Reference: https://www.w3schools.com/graphics/svg_rect.asp

Click here for DEMO

Happy CODING!!!

Thank you:)

Comments

Popular posts from this blog

Display and Edit CLOB Content in Oracle APEX

Allow Only Number/Decimal values In a Number/Text Field Using JavaScript in Oracle APEX

Copy the value of an Item to Clipboard in Oracle APEX