Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
aaah... juniors. Ranting behind your back for stupid requests that seem stupid only because they don't understand it, then offering a solution that makes you rant behind their backs.
-
Wack61917yJust out of curiosity, is it only the `>=` checks that are unneccesarry? Or would you have liked it with single if and `return`
Or rather a function like
if (label < 15) {
e.labelContent = (label == 0 ? "0" : "$150k");
return;
}
var multiplyer = Math.floor(label/15);
if (multiplyer == 1) {
e.labelContent = "$500k";
return;
}
e.labelContent = "$" + (multiplyer * 0.5) + "M"; -
Sorry guys, I'm not expecting anything fancy here. I'd prefer two methods - one for converting the y axis values to 'K' value with an appropriate multiplier and other to convert 'K' to 'M' wherever applicable.
I asked a junior dev to convert y axis value to dollars and render the same on a chart. This is what he does.
undefined