Adding HTMl symbols to X-axis labels

I am using python to create an interactive plotly bar chart to display metrics. I need to use a bar chart but I have been asked to insert triangles in front of the x-axis labels. The triangle will point upwards if the metric increased from last month and will point downwards if it decreases. I have been able to add them using Unicode, but they want to me to add colors like green and red for increase and decrease. I tried to add html into the axis labels but I get an error Object of type HTML is not JSON serializable.
This is code I am trying to use
span style="color: transparent; text-shadow: 0 0 0 rgb(42, 170, 82); ">&# 9650;</span Net Promoter Score
β–² Net Promoter Score
Is there a solution to adding symbols in front of text?

Hi @nc123,

Unfortunately it’s not possible to specify arbitrary HTML spans and styling to plotly labels. The reason for this is that Plotly.js only supports a subset of HTML markup. The support features are described in https://help.plot.ly/adding-HTML-and-links-to-charts/#step-2-the-essentials.

As a side note, you may want to check out the new waterfall trace type in case it’s relevant to you usecase. See https://plot.ly/python/waterfall-charts/.

-Jon