gpt4 book ai didi

highcharts - 下载 highchart 时需要 Highchart 水印图像

转载 作者:行者123 更新时间:2023-12-04 08:27:28 24 4
gpt4 key购买 nike

我正在为 Web 应用程序使用 HighCharts Javascript 库。当我下载 Highchart 时,我需要 Highchart 水印图像。
我正在使用普通的 hicgchart 代码。
Code here

Highcharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: 'Stacked bar chart'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
yAxis: {
min: 0,
title: {
text: 'Total fruit consumption'
}
},
legend: {
reversed: true
},
plotOptions: {
series: {
stacking: 'normal'
}
},
series: [{
name: 'John',
data: [5, 3, 4, 7, 2]
}, {
name: 'Jane',
data: [2, 2, 3, 2, 1]
}, {
name: 'Joe',
data: [3, 4, 4, 2, 5]
}]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>

<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>


enter image description here

有什么建议?

最佳答案

请使用此代码

var chart = new Highcharts.Chart({

chart: {
renderTo: 'container',
events: {
load: function() {
this.renderer.image('/image/E1r9X.png', 200, 20, 163, 187)
.attr({
zIndex:1000 })
.add();
}
}
},

xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},

series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}],

exporting: {
enableImages: true
}

});
image{display:none;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script><div id="container" style="height: 300px"></div>

关于highcharts - 下载 highchart 时需要 Highchart 水印图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51474920/

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