Getting the order of values so none are hidden
As far as I can undestand the key point is that you need to have an order of the fields based on the fields value from the greater to the smaller.

I think you can solve it just sorting the fields like it is an array:

const firstElement = obj[0];
const sortedNamedValues = Object.keys(firstElement)
    .sort((a, b) =&gt; {
        return firstElement[b] - firstElement[a] 
    });


So in sortedNamedValues are now the fields names sorted from the greater to the smaller.

Now I see the bar class is sticket to the field name: actual with bar, projected with bar2 and so on.

That could be done in a lookup table map:

const classesToValues = {
    actual: 'bar',
    projected: 'bar2',
    le: 'bar3'
};


So your assignment code will became:

const biggesteClass = classesToValues[sortedNamedValues[0]];
const biggestVal = firstElement[sortedNamedValues[0]];
const secondClass = classesToValues[sortedNamedValues[1]];
const secondVal = firstElement[sortedNamedValues[1]];
const thirdClass = classesToValues[sortedNamedValues[2]];
const thirdVal = firstElement[sortedNamedValues[2]];