is there a way to set the unique id of a page component in javascript?

The series can be updated as necessary. Here’s a snippet we used on Opps. You can alter the series as you see fit.

// this snippet has been created in order to sort the series in the chart by the stage order // in the sales process assigned to the Prospect Clinic Record Type var chartObj = arguments[0], Opportunities = skuid.$M('Opportunities'), StageName, sortedSeries= [], $ = skuid.$; // to get the sort order, we need to find the Stage field metadata in the Opportunities models list of fields $.each(Opportunities.fields, function(f,field){ if (field.id === "StageName"){ StageName = field; return false; } }); // now use this field to create a temporary array to replace the current series // loop through entries in order to then find the corresponding series by the same name // in order to add it to the temporary array $.each(StageName.picklistEntries, function(p,entry){ $.each(chartObj.series, function(s,series){ if (series.name === entry.label){ sortedSeries.push(series); } }); }); // empty original series chartObj.series.length = 0; // insert sorted chart $.each(sortedSeries,function(ss,sseries){ chartObj.series.push(sseries); }); // console.log(chartObj); // console.log(Opportunities);<br>