使用pdf输入的自由文本导出高图

时间:2016-08-26 12:12:00

标签: highcharts bar-chart export-to-pdf

我正在使用Highchart api来显示条形图。此外,我在该图表下方还有一个文本区域,可以为用户输入一些文本。

我想以PDF格式导出此图表,但同时我想以pdf格式渲染textarea的文本。

现在我只能看到pdf中的图表。这很好。

<script>
$(function () {
    var listJS = <%=list4%>;
    window.chart = new Highcharts.Chart({
        chart: {renderTo : 'container', type: 'column'},

        title: {
            text: 'Stacked bar chart'
        },
        xAxis: {
            categories: ['PreviousMonthutilizationforCPU', 'CurrentMonthUtilizationforCPU', 'Week2','Week2','Week3','Week4']
        },
        yAxis: {
            min: 0,
            title: {
                text: 'POD'
            }
        },



        tooltip: {
            formatter: function () {
                return '<b>' + this.x + '</b><br/>' +
                    this.series.name + ': ' + this.y + '<br/>' +
                    'Total: ' + this.point.stackTotal;
            }
        },
        legend: {
            reversed: true
        },
        plotOptions: {
            series: {
                stacking: 'normal'
            }
        },

        series: listJS,

        exporting: {
            enabled: true
        }
    });

    $("#export2pdf").click(function(){
           chart.exportChart({
               type: 'application/pdf',
               filename: 'wow-pdf'
    });
});
});

</script>

0 个答案:

没有答案