Forum Discussion
rapidbisupport
11-27-2023Data Pipeline
Hi zohebakber ,
You can use the widget snippet below to change the order of the lines / legend in the break by:
let order = ['Greece', 'Alaska']
widget.on('processresult', (w, args) => {
const unlistedItems = args.result.series.filter((i) => { return !order.includes(i.name) })
order = [...order, ...unlistedItems]
args.result.series.sort((a, b) => {
return order.indexOf(b.name) - order.indexOf(a.name)
})
})
What we are doing here is:
- defining an order for the items we're interested in,
- putting any items we didn't declare at the end of the order list and then,
- ordering the lines based on our new order list.
Let me know if this works for you.
Thanks,
Daniel
RAPID BI
RAPID BI - Sisense Professional Services | Implementations | Custom Add-ons