23 lines
658 B
HTML
23 lines
658 B
HTML
<div id="chart" class="text-white">
|
|
{{.RenderedElement}}
|
|
</div>
|
|
|
|
<script type="module" defer src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js"></script>
|
|
<script>
|
|
window.onload = function () {
|
|
const script = `{{.RenderedScript}}`;
|
|
eval(script);
|
|
};
|
|
window.onresize = function () {
|
|
document.querySelectorAll('canvas, div').forEach(
|
|
function (e) {
|
|
const instance = echarts.getInstanceByDom(e);
|
|
if (instance) {
|
|
instance.resize()
|
|
console.log(instance, "resize")
|
|
}
|
|
}
|
|
);
|
|
}
|
|
</script>
|