......
$.each(GRAPH1names, function (i, name) {
$.getJSON('actions.php?get_live_data&id_name='+name, function(GRAPH1live_data) {
var live_data=JSON.parse(GRAPH1live_data);
if (i==0) GRAPH1series_0.addPoint([live_data[0],live_data[1]], true, true);
.............
$.each(GRAPH1names, function (i, name) {
GRAPH1series_0.addPoint
setInterval(function ()
{
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
# root /var/www/html;
root /var/www;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
# deny all;
}
}
server {
listen 7535 default_server;
listen [::]:7535 default_server;
server_name _;
root /usr/share/phpmyadmin;
index index.php;
error_log /var/www/logs/pma.error.log;
access_log /var/www/logs/pma.access.log;
keepalive_timeout 1600;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
файл надо засунуть туда где у вас все конфиги доменов лежат
Я знаю.
Так и суть вопроса в "как сделать одно событие (функцию) синхронизации?" Одно.
Т.е. как то так
Да дублирование кода, да 2 вызова getJSON (по идее нужно сделать один) - пока не суть.
Как мне вынести код вне function createChartGRAPH1?
Там, разумеется, не видны переменные.
Задавал вопрос и тут
https://forum.highcharts.com/topic41048/?sid=a20ed...
Рекомендуют как то так
https://jsfiddle.net/gh/get/library/pure/highchart...
Но, к сожалению, я пока не понимаю как мне переделать мой код (