Change xTrace Box Size in Power Chart

Currently, the width can only be set through the props.interaction.xTrace.infoBox.width property. You can kind of fudge a dynamic width by binding it to the props.pens list, looping through any pens that might exist, and checking the length of each pen name in order to determine how many characters are in the longest pen name, then multiply that character length by an arbitrary number you’d have to play around with to determine. Since the text in the info box uses a proportional font (not all letters take up the same width), this can only ever be an approximation.

Personally, I prefer to make the infobox background fill and stroke transparent so I don’t have to see it at all:

2 Likes