javascript - Highcharts change of data does not work -


when use code, should work

        $('#somefieldname').change(function(){          $('#container').empty();          var link='highcharts.php';           var myjson= $.ajax({            url: link,            async: false         }).responsetext;          myjson = myjson.replace("],]", "]]");          myjson=eval(myjson);          highcharts.chart('container', {           chart: {             type: 'scatter',             zoomtype: 'xy'           },           title: {             text: ''           },           subtitle: {             text: ''           },           xaxis: {             type: 'datetime',             labels: {                     format: '{value:%d.%m.%y}',                     rotation: 45,                     align: 'left'                 },             title: {               enabled: true,               text: 'date of entry'             },             startontick: true,             endontick: true,             showlastlabel: true           },           yaxis: {             title: {               text: 'value'             }           },           legend: {             layout: 'vertical',             align: 'left',             verticalalign: 'top',             x: 100,             y: 70,             floating: true,             backgroundcolor: (highcharts.theme && highcharts.theme.legendbackgroundcolor) || '#ffffff',             borderwidth: 1           },           plotoptions: {             scatter: {               marker: {                 radius: 5,                 states: {                   hover: {                     enabled: true,                     linecolor: 'rgb(100,100,100)'                   }                 }               },               states: {                 hover: {                   marker: {                     enabled: false                   }                 }               },               tooltip: {                 headerformat: '<b>{series.name}</b><br>',                 pointformat: ' {point.y}'               }             }           },           series: [{             name: 'value',             color: 'rgba(223, 83, 83, .5)',             data: myjson           }]         });       }); 

and these data highcharts.php

[[new date("01.01.2017").gettime(), 700],[new date("07.03.2017").gettime(), 21000],[new date("07.03.2017").gettime(), 25000],[new date("07.03.2017").gettime(), 33000],[new date("07.03.2017").gettime(), 27000],[new date("07.03.2017").gettime(), 30000],[new date("11.05.2017").gettime(), 0],[new date("11.05.2017").gettime(), 0],[new date("11.05.2017").gettime(), 0],[new date("11.05.2017").gettime(), 0],]

i graph correct dates, graph looks nice, everying ok.

but when change #somefiledname value , data, highcharts.php nothing. why?

[[new date("31.01.2017").gettime(), 195000],[new date("31.01.2017").gettime(), 225000],[new date("31.01.2017").gettime(), 245000],[new date("31.01.2017").gettime(), 185000],[new date("31.01.2017").gettime(), 239000],[new date("20.03.2017").gettime(), 1300],[new date("20.03.2017").gettime(), 3200],[new date("20.03.2017").gettime(), 2700],[new date("20.03.2017").gettime(), 4200],[new date("20.03.2017").gettime(), 1500],]

data because of thread here highcharts scatter external data


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -