the goal is to replace native Google Charts labels with icons. Doing:
google.visualization.events.addListener(chart, 'ready', function () {
const chartLayout = chart.getChartLayoutInterface(),
chartBounds = chartLayout.getChartAreaBoundingBox();
for (let i = 0; i < chartData.getNumberOfRows(); i++) {
console.log(chartLayout)
const axisLabelBounds = chartLayout.getBoundingBox(`vAxis#0#label#${i}`),
thumb = container.appendChild(document.createElement('img'));
console.log(axisLabelBounds)
thumb.src = chartData.getProperty(i, 0, 'icon');
thumb.style.position = 'absolute';
thumb.style.width = '16px';
thumb.style.height = '16px';
thumb.style.zIndex = '1';
thumb.style.top = axisLabelBounds.top - 8 + 'px';
thumb.style.left = axisLabelBounds.left - 25 + 'px';
}
});
chart.draw(chartData, getBarChartOptions({
title: null
}))
It works great on macOS and Linux:
{left: 36.75, top: 111.890625, width: 0.25, height: 277.21875}
But not on Windows:
{left: 0, top: 0, width: 0, height: 0}
Same browser, the latest Chrome. Any ideas?
Thanks a lot!