I need to place a button on specific xAxis value. My xAxis is of type 'datetime' and my button is added as follows:
Code: Select all
const safetyForms = selectedDriverSafetyForms.get();
if (safetyForms.length > 0) {
let xIndex = 0;
let yIndex = 0;
_.each(safetyForms, function (form, index) {
xIndex = chart.plotLeft + 100 + 40 * (index); //Get xIndex for creationDate
yIndex = chart.plotTop;
debugger;
chart.renderer
.text(
`<button class="btn btn-floating btn-floating-small b-orange-light-bg right" title="${safetyFormTitle[form.category]} Form"><i class="material-icons">insert_drive_file</i></button>`,
xIndex,
yIndex,
true
)
.on('click', function () {
window.open(`/reports/forms/safety/form/${form.reference}`);
})
.add();
});
The below image represent what I have against what I need
https://ibb.co/BfpbHmf
Hope you can help me