Showing results for 
Search instead for 
Did you mean: 

Column Chart - Reorder X-Axis

Sisense Team Member
Sisense Team Member

When creating a column chart you'd sometimes want to reorder the category fields

Apply the following widget script:

widget.on('processresult', function(widget,result) {
// Wanted Order
let order = ['New','Used','Refurbished','Unspecified']

// For each series
result.result.series.forEach(function(series) {
let newData = new Array(;
for (let i = 0 ; i < ; i++) {
let categoryName =[i].selectionData[0]
let shouldBeAt = order.indexOf(categoryName)
newData[shouldBeAt] =[i]
} = newData

// Replace X-Axis Labels
result.result.xAxis.categories = order
Before After
Ophir_Buchman_0-1652946574383.png Ophir_Buchman_1-1652946592071.png
Voice of Customer
Impact Business Intelligence (BI) and Analytics Market Research

Click Here & Complete Dresner's Wisdom of Crowds® Market Study Survey Today!

Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Need additional support?:

Community Support Request

Don't miss out:

Earn a BETA Launch Challenge Badge!