This demo shows how you can replace each category label with an image.
The solution comes from applying fill
attribute to each label by a few lines of JavaScript code.
We use rendered
and resized
events to execute the custom code, which gets all category axis labels within the chart using JavaScript function getElementsByClassName()
then looks for a image
attribute in data to replace it with.
Please note that addClassNames
must be enabled in chart config for this to work. Here’s more information about applying class names to chart elements.
Also, check out this related demo which shows how to apply color for each label individually.