when creating the legend display table, variable 'array' was referencing tableData by reference instead of value, ultimate causing the first row of the legend to display incorrect values.
This is the first time I've ever proposed a fix to be merged into someone else's project, please be gentle with me. I slapped a JSON.parse(JSON.stringify()) around the reference to tableData to fix.
when creating the legend display table, variable 'array' was referencing tableData by reference instead of value, ultimate causing the first row of the legend to display incorrect values.