Highcharts在导出时添加图片 [英] Highcharts add image on export

查看:79
本文介绍了Highcharts在导出时添加图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Highcharts与导出功能,据我所知将图像添加到图表中我可以使用可以正常工作的呈现器,但我不希望图片(徽标)出现在应用程序中的图表上它只出现在出口,我将如何能够做到这一点?

解决方案

您应该使用 chartOptions 对象,然后在放置渲染器代码的地方捕获加载事件。

 出口:{
chartOptions:{
图表:{
events:{
load:function(){
this.renderer.image('http://highcharts.com/demo/gfx/sun.png',100,100,30,30)
.add();





$ b code $ pre

示例: http://jsfiddle.net/rLfj69b9/2/


Im using Highcharts with the export feature, from what I understand to add images to the chart I can use the renderer which works fine however I do not want the image (a logo) to appear on the chart in the app I want it to appear only on export, how would I be able to do this?

解决方案

You should use chartOptions object and then catch load event where you place renderer code.

exporting:{
                chartOptions:{
                    chart:{
                        events:{
                            load:function(){
                                this.renderer.image('http://highcharts.com/demo/gfx/sun.png', 100, 100, 30, 30)
                .add();

                            }
                        }
                    }
                }
    },

Example: http://jsfiddle.net/rLfj69b9/2/

这篇关于Highcharts在导出时添加图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆