chart.js ОШИБКА: Превышено максимальное значение данных диаграммы (374)

#php #chart.js

Вопрос:

Я создал диаграмму с Chart.js и он показывает мне следующее сообщение об ошибке:

введите описание изображения здесь

 $obj = (object) [ 'chart' =gt; (object)[  'type' =gt; 'bar',  'data' =gt; (object)[  'labels' =gt; array("08:10:00","08:12:00","08:14:00","08:16:00","08:18:00","08:20:00","08:22:00","08:24:00","08:26:00","08:28:00","08:30:00","08:32:00","08:34:00","08:36:00","08:38:00","08:40:00","08:42:00","08:44:00","08:46:00","08:48:00","08:50:00","08:52:00","08:54:00","08:56:00","08:58:00","09:00:00","09:02:00","09:04:00","09:06:00","09:08:00","09:10:00","09:12:00","09:14:00","09:16:00","09:18:00","09:20:00","09:22:00","09:24:00","09:26:00","09:28:00","09:30:00","09:32:00","09:34:00","09:36:00","09:38:00","09:40:00","09:42:00","09:44:00","09:46:00","09:48:00","09:50:00","09:52:00","09:54:00","09:56:00","09:58:00","10:00:00","10:02:00","10:04:00","10:06:00","10:08:00","10:10:00","10:12:00","10:14:00","10:16:00","10:18:00","10:20:00","10:22:00","10:24:00","10:26:00","10:28:00","10:30:00","10:32:00","10:34:00","10:36:00","10:38:00","10:40:00","10:42:00","10:44:00","10:46:00","10:48:00","10:50:00","10:52:00","10:54:00","10:56:00","10:58:00","11:00:00","11:02:00","11:04:00","11:22:00","11:24:00","11:26:00","11:28:00","11:30:00","11:32:00","11:34:00","11:36:00","11:38:00","11:40:00","11:42:00","11:44:00","11:46:00","11:48:00","11:50:00","11:52:00","11:54:00","11:56:00","11:58:00","12:00:00","12:02:00","12:04:00","12:06:00","12:08:00","12:10:00","12:12:00","12:14:00","12:16:00","12:18:00","12:20:00","12:22:00","12:24:00","12:26:00","12:28:00","12:30:00","12:32:00","12:34:00","12:36:00","12:38:00","12:40:00","12:42:00","12:44:00","12:46:00","12:48:00","12:50:00","12:52:00","12:54:00","12:56:00","12:58:00","13:00:00","13:02:00","13:04:00","13:06:00","13:08:00","13:10:00","13:12:00","13:14:00","13:16:00","13:18:00","13:20:00","13:22:00","13:24:00","13:26:00","13:28:00","13:30:00","13:32:00","13:34:00","13:36:00","13:38:00","13:40:00","13:42:00","13:44:00","13:46:00","13:48:00","13:50:00","13:52:00","13:54:00","13:56:00","13:58:00","14:00:00","14:02:00","14:04:00","14:06:00","14:08:00","14:10:00","14:12:00","14:14:00","14:16:00","14:18:00","14:20:00","14:22:00","14:24:00","14:26:00","14:28:00","14:30:00","14:32:00","14:34:00","14:36:00","14:38:00","14:40:00","14:42:00","14:44:00","14:46:00","14:48:00","14:50:00","14:52:00","14:54:00","14:56:00","14:58:00","15:00:00","15:02:00","15:04:00","15:06:00","15:08:00","15:10:00","15:12:00","15:14:00","15:16:00","15:18:00","15:20:00","15:22:00","15:24:00","15:26:00","15:28:00","15:30:00","15:32:00","15:34:00","15:36:00","15:38:00","15:40:00","15:42:00","15:44:00","15:46:00","15:48:00","15:50:00","15:52:00","15:54:00","15:56:00","15:58:00","16:00:00","16:02:00","16:04:00","16:06:00","16:08:00","16:10:00","16:12:00","16:14:00","16:16:00","16:18:00","16:20:00","16:22:00","16:24:00","16:26:00","16:28:00","16:30:00","16:32:00","16:34:00","16:36:00","16:38:00","16:40:00","16:42:00","16:44:00","16:46:00","16:48:00","16:50:00","16:52:00","16:54:00","16:56:00","16:58:00","17:00:00","17:02:00","17:04:00","17:06:00","17:08:00","17:10:00","17:12:00","17:14:00","17:16:00","17:18:00","17:20:00","17:22:00","17:24:00","17:26:00","17:28:00","17:30:00","17:32:00","17:34:00","17:36:00","17:38:00","17:40:00","17:42:00","17:44:00","17:46:00","17:48:00","17:50:00","17:52:00","17:54:00","17:56:00","17:58:00","18:00:00","18:02:00","18:04:00","18:06:00","18:08:00","18:10:00","18:12:00","18:14:00","18:16:00","18:18:00","18:20:00","18:22:00","18:24:00","18:26:00","18:28:00","18:30:00","18:32:00","18:34:00","18:36:00","18:38:00","18:40:00","18:42:00","18:44:00","18:46:00","18:48:00","18:50:00","18:52:00","18:54:00","18:56:00","18:58:00","19:00:00","19:02:00","19:04:00","19:06:00","19:08:00","19:10:00","19:12:00","19:14:00","19:16:00","19:18:00","19:20:00","19:22:00","19:24:00","19:26:00","19:28:00","19:30:00","19:32:00","19:34:00","19:36:00","19:38:00","19:40:00","19:42:00","19:44:00","19:46:00","19:48:00","19:50:00","19:52:00","19:54:00","19:56:00","19:58:00","20:00:00","20:02:00","20:04:00","20:06:00","20:08:00","20:10:00","20:12:00","20:14:00","20:16:00","20:18:00","20:20:00","20:22:00","20:24:00","20:26:00","20:28:00","20:30:00","20:32:00","20:34:00","20:36:00","20:38:00","20:40:00","20:42:00","20:44:00","20:46:00","20:48:00","20:50:00","20:52:00"),  'datasets' =gt; array(  (object)[  'label'=gt; 'Dataset 1',  'backgroundColor' =gt; "rgba(255, 99, 132, 0.5)",  'borderColor' =gt; "rgb(255, 99, 132)",  'borderWidth' =gt; 1,  'data' =gt; array(7.3,7.8,8.1,8.4,8.7,9,9.1,9.3,9.4,9.4,9.3,9.1,9,8.8,8.7,8.5,8.4,8.2,8.2,8.1,8,7.9,7.9,7.9,7.8,7.7,7.9,7.8,7.7,7.7,7.6,7.5,7.5,7.4,7.3,7.3,7.4,7.3,7.3,7.4,7.5,7.5,7.6,7.6,7.7,7.6,7.5,7.5,7.8,8,8,8,7.9,7.9,7.8,7.8,7.7,7.7,7.6,7.6,7.9,8,8,8,8,7.9,7.9,7.9,7.9,7.9,7.8,7.7,7.7,7.6,7.6,7.5,7.5,7.4,7.4,7.3,7.3,7.3,7.2,7.2,7.2,7.1,7.1,7.1,7.3,7.9,8,7.9,7.9,7.9,8.2,8.3,8.3,8.6,8.9,8.8,8.7,8.6,8.5,8.4,8.3,8.3,8.2,8.4,8.3,8.2,8.2,8.1,8,8.1,8,8,8,8,7.9,8,8,8,8.1,8.3,8.4,8.4,8.3,8.2,8.2,8.3,8.3,8.2,8.3,8.3,8.2,8.2,8.1,8.1,8,8.1,8.2,8.3,8.3,8.4,8.4,8.4,8.3,8.3,8.3,8.3,8.3,8.3,8.2,8.3,8.3,8.3,8.3,8.3,8.2,8.2,8.5,8.5,8.8,8.9,8.8,8.8,8.7,8.6,8.6,8.5,8.5,8.4,8.4,8.4,8.4,8.4,8.4,8.3,8.3,8.3,8.3,8.3,8.2,8.2,8.2,8.7,9.2,9.3,9.3,9.2,9.1,9,9,8.9,8.9,8.8,8.7,8.7,8.6,8.6,8.5,8.5,8.8,8.8,8.8,8.7,8.7,9,9.4,9.5,9.4,9.3,9.3,9.2,9.2,9.2,9.1,9,8.9,8.9,8.8,8.7,8.7,8.6,8.6,8.5,8.5,8.4,8.4,8.4,8.5,8.4,9,9.2,9.1,9,8.9,8.8,8.9,8.9,8.9,8.8,8.7,8.6,8.6,8.5,8.5,9.8,12.6,13,12.6,12.2,12,13.9,15.7,15.5,15.2,14.7,14.1,13.7,13.4,13.3,13.2,13,12.7,12.5,12.3,12.1,11.9,11.7,11.6,11.6,11.6,11.5,11.4,11.2,11.3,11.5,11.5,11.5,11.4,11.2,11.1,11,10.9,10.8,10.7,10.6,10.5,10.4,10.3,10.2,10.1,10,9.9,10.1,10.6,10.6,10.5,10.5,10.8,10.9,10.9,10.8,10.7,10.7,10.6,11.1,11.4,11.7,11.6,11.5,11.4,11.3,11.1,11,10.9,10.8,10.7,10.5,10.4,10.3,10.2,10.1,10,9.9,9.8,9.7,9.6,9.5,9.4,9.4,9.3,9.2,9.1,9,9,8.9,8.8,8.8,8.7,8.6,8.6,8.5,8.4,8.4,8.3,8.3,8.2,8.1,8.1,8,8,7.9,7.9,7.8,7.8,7.7,7.7,7.6,7.6,7.5,7.5,7.5,7.4,7.4,7.3,7.3,7.3,7.2,7.2,7.1,7.1,7.1)  ],  (object)[  'label'=gt; 'Dataset 2',  'backgroundColor' =gt; "rgba(54, 162, 235, 0.5)",  'borderColor' =gt; "rgb(54, 162, 235)",  'borderWidth' =gt; 1,  'data' =gt; array(0.3,0.8,1.1,1.4,1.7,2,2.1,2.3,2.4,2.4,2.3,2.1,2,1.8,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3.9,3.8,3.7,3.6,3.5,3.4,3.3,3.2,3.1,3,2.9,3.1,3.6,3.6,3.5,3.5,3.8,3.9,3.9,3.8,3.7,3.7,3.6,4.1,4.4,4.7,4.6,4.5,4.4,4.3,4.1,4,3.9,3.8,3.7,3.5,3.4,3.3,3.2,3.1,3,2.9,2.8,2.7,2.6,2.5,2.4,2.4,2.3,2.2,2.1,2,2,1.9,1.8,1.8,1.7,1.6,1.6,1.5,1.4,1.4,1.3,1.3,1.2,1.1,1.1,1,1,0.9,0.9,0.8,0.8,0.7,0.7,0.6,0.6,0.5,0.5,0.5,0.4,0.4,0.3,0.3,0.3,0.2,0.2,0.1,0.1,0.1)  ],  )  ],  'options' =gt; (object)[  'title' =gt; (object)[  'display' =gt; true,  'text'=gt; "Bar Chart"  ],  'title' =gt; (object)[  'datalabels' =gt;(object)[  'anchor'=gt; "center",  'align'=gt; "center",  'color'=gt; "#666",  'font'=gt; (object)['weight' =gt; 'normal']  ]  ]  ] ]];$chart = json_encode($obj);  

Каков предел данных, сгенерированных диаграммой chart.js может содержать?

Комментарии:

1. Сколько точек данных вы пытаетесь построить, так как чем больше вы строите, тем больше времени уходит на обработку, но я не получаю этой ошибки, остановился после попытки набрать 100 тысяч очков, так как загрузка слишком велика для пользовательского опыта и она становится слишком запаздывающей

2. 374 этикетки и 374 элемента в yAxisID «A» и 374 элемента в yAxisID B …

3. Ну, это не дает мне никакой ошибки, как указано в моем первом комментарии, я вставил 100 тысяч точек данных, поэтому, пожалуйста, отредактируйте свой вопрос и добавьте воспроизводимый пример или отладочный код, потому что в его текущем состоянии его невозможно проверить