I'm looking to use a react component within a highchart axis label. I've tried a number of different methods to accomplish this with no success.
Here is where I am right now:
import React from 'react'
import ReactHighcharts from 'react-highcharts
import MyOtherReactComponent from '...'
export const MyReactChart = () => (
<ReactHighcharts config={{
...
xAxis: [{
categories: ['Item 1', 'Item 2'],
labels: {useHTML: true, formatter: function() {
return this.value + <MyOtherReactComponent options={options} />
}}
}, {// Secondary xAxis}]
}}
)
I keep getting the following:
Item 1 [Object, Object]
Item 2 [Object, Object]
Can someone tell me how I can accomplish this?
Much appreciated and cheers!