gpt4 book ai didi

javascript - jqplot转换为图像不显示y轴html

转载 作者:行者123 更新时间:2023-11-28 05:55:47 24 4
gpt4 key购买 nike

我在 y 轴刻度中添加了 html,它在浏览器窗口中打印得很好。

Browser window show it like this

但是,当我使用 $('#chart').jqplotToImageStr({}) 将图形转换为图像时,它会删除刻度的 html 部分。

image using jqplotToImageStr({})

我尝试了什么?

我尝试通过 jqplot 转义 HTML,并使用 html_entity_decode 在 PHP 中解码刻度,但都没有成功。

期望的结果

我希望转换后的图像也包含图像中打印的刻度的 HTML 部分(绿色、黄色、红色框)。

感谢您的帮助。

最佳答案

以防万一有人正在寻找答案。

将以下行添加到核心 jqplot 库的第 9201 行。

if ($(el).css('background-color') && $(el).css('width') && $(el).css('height')){
newContext.fillStyle = $(el).css('background-color');
newContext.fillRect(left, top, $(el).css('width'), $(el).css('height'));
}

关于javascript - jqplot转换为图像不显示y轴html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37702817/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com