高亮图上下文菜单按钮随页面刷新而增加

时间:2015-02-20 10:43:51

标签: highcharts

我在一个网页上有超过1个高图。但是当我刷新页面时,我会在另外的高级图表中添加另一个上下文菜单按钮。我试图在重新创建之前破坏高图,但是没有用。任何想法如何阻止上下文菜单按钮增加页面刷新?

Highcharts incrementing context menus

    // Submits form values and ...
$('#dateform').submit(function (event) {

    var data = $(this).serialize();

    var monthSelect = $("#month option:selected").text();
    var yearSelect = $("#year option:selected").text();
    $("#reportDate").text(monthSelect + " " + yearSelect);



    //-------------------------------------------------------------------------------

    // Procedures - Bar

    $.getJSON('reports_procedure_count_bar_ajax.cshtml', data, function (chartData) {


        // Build the chart
        $('#container1').highcharts({
            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: 'Browser market shares at a specific website, 2014'
            },
            tooltip: {
                pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: false
                    },
                    showInLegend: true
                }
            },
            series: [{
                type: 'pie',
                name: 'Browser share',
                data: [
                    ['Firefox', 45.0],
                    ['IE', 26.8],
                    {
                        name: 'Chrome',
                        y: 12.8,
                        sliced: true,
                        selected: true
                    },
                    ['Safari', 8.5],
                    ['Opera', 6.2],
                    ['Others', 0.7]
                ]
            }]
        });


    });

    $.getJSON('reports_procedure_count_bar_ajax.cshtml', data, function (chartData) {

        // Build the chart
        $('#container2').highcharts({
            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: 'Browser market shares at a specific website, 2014'
            },
            tooltip: {
                pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: false
                    },
                    showInLegend: true
                }
            },
            series: [{
                type: 'pie',
                name: 'Browser share',
                data: [
                    ['Firefox', 45.0],
                    ['IE', 26.8],
                    {
                        name: 'Chrome',
                        y: 12.8,
                        sliced: true,
                        selected: true
                    },
                    ['Safari', 8.5],
                    ['Opera', 6.2],
                    ['Others', 0.7]
                ]
            }]
        });


    });


    return false;
});

0 个答案:

没有答案