Using an editable table with HighChart and having the chart refresh with change

后端 未结 2 1123
执笔经年
执笔经年 2021-01-17 05:45

I am building a prototype that uses High charts - Data defined in a HTML table, I have applied an editable feature using jQuery so that the cells can be edited by the user.

2条回答
  •  [愿得一人]
    2021-01-17 06:32

    The issue is that you were not defining your chart in:

    $("#refresh").click(function() {
                var options = chart.options;
                chart = new Highcharts.Chart(options);
            });
    

    Try defining it before you call the new HighCharts code:

    $("#refresh").click(function () {
        var chart = $('#container').highcharts();
        var options = chart.options;
        chart = new Highcharts.Chart(options);
    });
    

    See example here.

    Also note you have some invalid syntax in the tooltip as well as some dangling commas.

提交回复
热议问题