0

我已经定义了一个高图表,我想将其导出为 excel 格式,我所知道的是将 exporting.js 文件包含到我们的视图中。我已经做到了,但仍然没有得到图表右侧的按钮导出它。即使我再次下载了 highchart JavaScript 文件并将其包含在内,以便我可以获得它的更新版本。我的代码是

<script src="~/Scripts/charts/highcharts.js" type="text/javascript"></script>
<script src="~/Scripts/charts/module/exporting.js" type="text/javascript"></script>
chart = new Highcharts.Chart({
                        chart: {
                            renderTo: 'chart',
                            type: 'column',
                            margin: [ 50, 50, 100, 80]
                        },
                        title: {
                            text: 'Stats'
                        },
                        subtitle: {
                            text: 'Stats'
                        },
                        xAxis: {
                            categories: eval(categories),
                            labels: {
                                rotation: -45,
                                align: 'right',
                                style: {
                                    fontSize: '13px',
                                    fontFamily: 'Verdana, sans-serif'
                                }
                            }
                        },
                        yAxis: {
                            min: 0,
                            title: {
                                text: 'Stats'
                            }
                        },
                        legend: {
                            layout: 'vertical',
                            backgroundColor: '#FFFFFF',
                            align: 'left',
                            verticalAlign: 'top',
                            x: 100,
                            y: 70,
                            floating: true,
                            shadow: true
                        },

                        plotOptions: {
                            column: {
                                pointPadding: 0.2,
                                borderWidth: 0
                            }
                        },
                        series: [{
                            name: 'Stats',
                            data: eval(catdata)
                        }]
                    });
4

0 回答 0