viewof chart = {
const placeholder = html`<div style="height:480px"></div>`;
yield placeholder;
new hpccChart.Bar()
.target(placeholder)
.columns(["label", "weight"])
.data([
["Google", 22, {link:"https://www.google.com"}],
["Bing", 32, {link:"https://www.bing.com"}],
["DuckDuckGo", 42, {link:"https://www.duckduckgo.com"}]
])
.overrideMethod("tooltipFormat", function(row) {
return "<h1>Hello and Welcome!</h1><br>" + JSON.stringify(row, undefined , 2);
})
.on("click", (row, col, sel) => {
if (row.__lparam) {
window.open(row.__lparam.link, "_blank");
placeholder.value = row;
placeholder.dispatchEvent(new CustomEvent("input"));
}
})
.lazyRender()
;
}