is there a way we can get the width of a simple string- I know with the HTML markup its possible via the getting the id from the dOM and then checking the width on that element. however in my case its rendering as a string value and I need to know the width of that string in order to add ellipses based on that. I can do it via CSS, however in CSS I'll have to define the width in order to get the ellipsis. I need to have customize width based on points rendered on a chart. is this even possible?
I tried length
var string = "Hello world- need to know width";
var len = string.length;
but im not sure of this is equivalent of width.