Referring to this advanced multi-range timeline.
I have custom svgs that I need to show in the data labels of my timeline horizontal bars.
Is it possible to show my svgs specifically in data labels?
I can’t use use icons etc since the svgs I have are very specific.
Since it is possible to make the [data labels display custom stuff] (https://apexcharts.com/docs/options/datalabels/) in the following way:
formatter: function(value, { seriesIndex, dataPointIndex, w }) { return w.config.series[seriesIndex].name + ": " + value }
I tried doing
import mysvg from "../src/assets/mysvg.svg"
let value = 5;
//other configs
formatter: function(value, { seriesIndex, dataPointIndex, w }) {
return mysvg + value; }
//other configs
But the end result is the data label just reads “src/assets/mysvg3rr23r233re3r4wr32e 5” or similar.
I also tried
return `${icon} ${value}`
and
return `<div><img src=${icon} alt="pic"></img><div>${value}</div></div>`