Forum Discussion

subramanian_cv's avatar
subramanian_cv
Data Storage
07-13-2022

Renaming the names of legend in a stacked bar chart

Hi there!

I have a field called "ABC" which is a boolean with "Yes" and "No" records. I am breaking by "ABC" in a column chart where the legends appear as "YES" and "NO" wherein I wanted to rename/append it as " ABC Yes" and "ABC No" on the widget legend ONLY

3 Replies

Replies have been turned off for this discussion
  • harikm007's avatar
    harikm007
    Data Warehouse

    Hi subramanian_cv ,

    Try this script : 

    
    widget.on('processresult', function(se, ev){
    	
    	ev.result.legend.labelFormatter= function () {
                return 'ABC ' + this.name;
            }
    
    })

    -Hari

  • right-click the chart with the records collection you need to rename, and click choose factsin the pick records supply dialog fieldunder Legend Entries (series), choose the statistics seriesand click Edit. inside the collection name containerkind the name you want to use...

  • Thanks James, Can I request a screenshot for the same because I can't find "choose facts" when I right click the chart