【问题标题】:Highcharts renderer.text as export onlyHighcharts renderer.text 仅作为导出
【发布时间】:2013-05-10 03:27:30
【问题描述】:

我有一个可选功能,用于添加 renderer.text 文本对象的图表。导出图表时,我希望仅在这种情况下添加它。下面我有关于如何访问渲染器和导出器的源代码。在评论部分插入这里是我认为它可能会去的地方,但我不确定语法。谢谢

    myChart.renderer.text('Filtered', 5, 10)
        .attr({rotation: 0})
        .css({color: '#4572A7', fontSize: '8px', fontStyle:'italic'})
        .add();
    myChart.exportChart(null, 
         {chart: 
             {backgroundColor: '#FFFFFF', width: 972, height:480 /*Insert Here*/
             }
         }
    );

【问题讨论】:

    标签: text highcharts renderer exporter


    【解决方案1】:

    你是对的 - 你应该使用加载事件为导出的图像添加额外的文本:http://jsfiddle.net/3bQne/88/

    chart.exportChart(null, {
            chart: {
                backgroundColor: '#FFFFFF',
                width: 972,
                height: 480,
                events: {
                    load: function () {
                        this.renderer.text('Filtered', 5, 10)
                            .attr({
                            rotation: 0
                        })
                            .css({
                            color: '#4572A7',
                            fontSize: '8px',
                            fontStyle: 'italic'
                        })
                            .add();
                    }
                }
            }
        });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-29
      • 2021-10-09
      • 2011-12-10
      • 2017-11-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多