Good day everyone!

Need to make a schedule. I liked this https://www.highcharts.com/demo/line-ajax very much. But the trouble is. It is necessary that the data were taken from MySQL, and not from a CSV file. How can this be done?

  • json suits him more - Artsiom

1 answer 1

You need to change configs a bit: add the data array to the series and delete data: { csv: csv }, from the main one.

 series: [{ name: 'All visits', lineWidth: 4, marker: { radius: 4 }, data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175] }, { name: 'New visitors', data: [43934, 52503, 54177, 69258, 97121, 119931, 137133, 154175] }] 

http://jsfiddle.net/L1mnxfwd/

  • And here I am using the php-file data from a database like JSON. How can I screw them in data? - Michael Dremurg
  • json_encode ($ data) - tcpack4
  • I understood this, I ran the php file separately, got an array. And how to tie the results to two data? - Michael Dremurg
  • you have a line 1 graph, collect an array of points, convert via json_encode and insert it into the first data. Also with the second. - tcpack4
  • Does JS have any function that takes a php file as an argument, and as a result displays an array of data? - Michael Dremurg