r34627673
r34627673

Reputation: 313

Why can't I export chart in highcharts?

I can't export chart in highchart even though I have added exporting.js in vendor/bower/highcharts

enter image description here

This is my index

<?php
    use app\assets\HighchartsAsset;


    HighchartsAsset::register($this);
    $this->title = 'Highcharts Test';
    ?>         

<!-- DATA USIA 2012 RINCI FOR MAGISTER -->
<div class="container">
<div class="row">
<div class="x_panel">
<div id="containers2012usia" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<?php $this->registerJs("
    $(function () {
    $('#containers2012usia').highcharts({
        chart: {
        type: 'column'
    },
        title: {
            text: 'Jumlah Pelamar Magister Berdasarkan Usia Tahun 2012',
            x: -20 //center
        },



        xAxis: $category2012usiaArray,
        legend: {
            enabled: false
        },

       yAxis: {
            title: {
                text: 'Jumlah'
            }
        },
        tooltip: {
            valueSuffix: '',

        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },

        series: [
            {
                name: '<25',

                data: $lessfaculty2012usia25,

            },
            {
                name: '25-29',

                data: $betweenfaculty2012usia25,

            },
            {
                name: '30-34',

                data: $betweenfaculty2012usia30,

            },
            {
                name: '35-39',

                data: $betweenfaculty2012usia35,

            },
            {
                name: '40-44',

                data: $betweenfaculty2012usia40,

            },
            {
                name: '45-49',

                data: $betweenfaculty2012usia45,

            },
            {
                name: '>=50',

                data: $morefaculty2012usia50,

            },
            {
                name: 'NotComplete',

                data: $notcomplete2012usia,

            }
            ],

        drilldown: {


            series: $drilldown2012usiaArray


        }
    })
});
")?>

</div>
</div> 
</div>

This is my HighchartsAsset

<?php
namespace app\assets;

use yii\web\AssetBundle;

class HighchartsAsset extends AssetBundle
{
    public $sourcePath = '@bower/highcharts';
    public $css = [];
    public $js = [
        'highcharts.js',
        'highcharts-more.js',
        'data.js',
        'drilldown.js',
        'exporting.js',
    ];

    public $depends = [
        'yii\web\JqueryAsset'
    ];
}

This is my chart

enter image description here

When I click download, the chart can't be downloaded. There is no response when I click download. What may I do so that I can export the chart? Thanks in advance

Upvotes: 0

Views: 652

Answers (1)

John M
John M

Reputation: 2600

By default, Highcharts will send the data to it's own export server at export.highcharts.com. I would suggest using a tool such as Fiddler to examine the request/response, perhaps you have a firewall issue that is blocking the request? If that's not acceptable - for example if your charts will contain sensitive company data, there are instructions here on how you can set up your own export server - it's not hard to do.

Upvotes: 1

Related Questions