Customizer Script to sort the horizontal axis value of a vertical bar chart in descending order

This article explains how to sort the horizontal axis value of a vertical bar chart in descending order using the customizer script.

 Instructions

  1. Below is a ‘Current Issue Values’ report example displayed by the Number field type custom field, “Verification fails“ in the chart and reports.



 

 

  1. Dataplane Customizer Scripts have the APIs that can be used, like “getColumn()” and “setType()”.

  2. By using the above APIs, one can sort the horizontal axis value of the vertical bar chart in descending order, as seen in the below Customizer Script :

    def FIELD_NAME = "Verification fails" def MIN_VALUE = 0 def MAX_VALUE = 20 customizeResult { // change this data column to integer values getColumn(FIELD_NAME).setType(DataColumnType.INTEGER) } customizeChart { // sort the numeric chart categories in descending order for (Integer i=MIN_VALUE; i <= MAX_VALUE; i++) { category i.toString() order (-i) } } customizeTable { // sort the table column in decending order sort FIELD_NAME order "desc" }



    Result:



 

  • Highlight important information in a panel like this one. To edit this panel's color or style, select one of the options in the menu.