Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何生成png的图像呢? #39

Open
liiqii opened this issue Oct 31, 2023 · 1 comment
Open

如何生成png的图像呢? #39

liiqii opened this issue Oct 31, 2023 · 1 comment

Comments

@liiqii
Copy link

liiqii commented Oct 31, 2023

<div id="chart" style="width: 600px; height: 400px;"></div>
        <script>
            var chartDom = document.getElementById('chart');
            var myChart = echarts.init(chartDom);
            var option;
            option= {"legend":{"right":"right"},"series":[{"name":"\u6570\u636e","type":"pie","radius":"60%","data":[{"value":12,"name":"GO"},{"value":22,"name":"PHP"},{"value":31,"name":"JAVA"}]}]}
            // option= {type_dis}
            option && myChart.setOption(option);
        </script>

image

咋HTML中写死上面代码确实能生成图片,但是我的需求是到出成PDF文件。导出到文件中后就会是空白。如何转换成png图像呢。我好导出PDF文件

@hisune
Copy link
Owner

hisune commented Oct 31, 2023

导出图片后,使用工具转成pdf:https://tools.pdf24.org/en/images-to-pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants