title: Can't read property of undefined javascript
body: <pre><code>[ { dateTime: '2016-03-30 05:55:53', value: '4.0' },
    { dateTime: '2016-03-30 05:55:55', value: '17.0' },
    { dateTime: '2016-03-30 05:55:57', value: '17.0' },
    { dateTime: '2016-03-30 05:55:59', value: '17.0' },
    { dateTime: '2016-03-30 05:56:01', value: '4.0' },
    { dateTime: '2016-03-30 05:56:03', value: '4.0' },
    { dateTime: '2016-03-30 05:56:05', value: '1.0' },
    { dateTime: '2016-03-30 05:56:07', value: '1.0' },
    { dateTime: '2016-03-30 05:56:09', value: '1.0' },
    { dateTime: '2016-03-30 05:56:11', value: '4.0' },
    { dateTime: '2016-03-30 05:56:13', value: '4.0' },
    { dateTime: '2016-03-30 05:56:15', value: '26.0' },
    { dateTime: '2016-03-30 05:56:17', value: '26.0' },
    { dateTime: '2016-03-30 05:56:19', value: '26.0' },
    { dateTime: '2016-03-30 05:56:21', value: '2.0' },
    { dateTime: '2016-03-30 05:56:23', value: '2.0' },
    { dateTime: '2016-03-30 05:56:25', value: '7.0' },
    { dateTime: '2016-03-30 05:56:27', value: '7.0' },
    { dateTime: '2016-03-30 05:56:29', value: '7.0' },
    { dateTime: '2016-03-30 05:56:31', value: '9.0' },
    { dateTime: '2016-03-30 05:56:33', value: '9.0' },
    { dateTime: '2016-03-30 05:56:35', value: '1.0' },
    { dateTime: '2016-03-30 05:56:37', value: '1.0' },
    { dateTime: '2016-03-30 05:56:39', value: '1.0' },
    { dateTime: '2016-03-30 05:56:41', value: '3.0' },
    { dateTime: '2016-03-30 05:56:43', value: '3.0' },
    { dateTime: '2016-03-30 05:56:45', value: '3.0' },
    { dateTime: '2016-03-30 05:56:47', value: '3.0' },
    { dateTime: '2016-03-30 05:56:49', value: '3.0' },
    { dateTime: '2016-03-30 05:56:51', value: '10.0' },
    { dateTime: '2016-03-30 05:56:53', value: '10.0' },
    { dateTime: '2016-03-30 05:56:55', value: '15.0' },
    { dateTime: '2016-03-30 05:56:57', value: '15.0' },
    { dateTime: '2016-03-30 05:56:59', value: '15.0' },
    { dateTime: '2016-03-30 05:57:01', value: '21.0' },
    { dateTime: '2016-03-30 05:57:03', value: '21.0' },
    { dateTime: '2016-03-30 05:57:05', value: '0.0' },
    { dateTime: '2016-03-30 05:57:07', value: '0.0' },
    { dateTime: '2016-03-30 05:57:09', value: '0.0' },
    { dateTime: '2016-03-30 05:57:11', value: '3.0' },
    { dateTime: '2016-03-30 05:57:13', value: '3.0' },
    { dateTime: '2016-03-30 05:57:15', value: '19.0' },
    { dateTime: '2016-03-30 05:57:17', value: '19.0' },
    { dateTime: '2016-03-30 05:57:19', value: '19.0' },
    { dateTime: '2016-03-30 05:57:21', value: '29.0' },
    { dateTime: '2016-03-30 05:57:23', value: '29.0' },
    { dateTime: '2016-03-30 05:57:25', value: '7.0' },
    { dateTime: '2016-03-30 05:57:27', value: '7.0' },
    { dateTime: '2016-03-30 05:57:29', value: '7.0' },
    { dateTime: '2016-03-30 05:57:31', value: '4.0' },
    { dateTime: '2016-03-30 05:57:33', value: '4.0' },
    { dateTime: '2016-03-30 05:57:35', value: '3.0' },
    { dateTime: '2016-03-30 05:57:37', value: '3.0' },
    { dateTime: '2016-03-30 05:57:39', value: '3.0' },
    { dateTime: '2016-03-30 05:57:41', value: '8.0' },
    { dateTime: '2016-03-30 05:57:43', value: '8.0' },
    { dateTime: '2016-03-30 05:57:45', value: '1.0' },
    { dateTime: '2016-03-30 05:57:47', value: '1.0' },
    { dateTime: '2016-03-30 05:57:49', value: '1.0' },
    { dateTime: '2016-03-30 05:57:51', value: '33.0' },
    { dateTime: '2016-03-30 05:57:53', value: '33.0' },
    { dateTime: '2016-03-30 05:57:55', value: '9.0' },
    { dateTime: '2016-03-30 05:57:57', value: '9.0' },
    { dateTime: '2016-03-30 05:57:59', value: '9.0' },
    { dateTime: '2016-03-30 05:58:01', value: '27.0' },
    { dateTime: '2016-03-30 05:58:03', value: '27.0' },
    { dateTime: '2016-03-30 05:58:05', value: '2.0' },
    { dateTime: '2016-03-30 05:58:07', value: '2.0' },
    { dateTime: '2016-03-30 05:58:09', value: '2.0' },
    { dateTime: '2016-03-30 05:58:11', value: '3.0' },
    { dateTime: '2016-03-30 05:58:13', value: '3.0' },
    { dateTime: '2016-03-30 05:58:15', value: '5.0' },
    { dateTime: '2016-03-30 05:58:17', value: '5.0' },
    { dateTime: '2016-03-30 05:58:19', value: '5.0' },
    { dateTime: '2016-03-30 05:58:21', value: '2.0' },
    { dateTime: '2016-03-30 05:58:23', value: '2.0' },
    { dateTime: '2016-03-30 05:58:25', value: '10.0' },
    { dateTime: '2016-03-30 05:58:27', value: '10.0' },
    { dateTime: '2016-03-30 05:58:29', value: '10.0' },
    { dateTime: '2016-03-30 05:58:31', value: '19.0' },
    { dateTime: '2016-03-30 05:58:33', value: '19.0' },
    { dateTime: '2016-03-30 05:58:35', value: '1.0' },
    { dateTime: '2016-03-30 05:58:37', value: '1.0' },
    { dateTime: '2016-03-30 05:58:39', value: '1.0' },
    { dateTime: '2016-03-30 05:58:41', value: '5.0' },
    { dateTime: '2016-03-30 05:58:43', value: '5.0' },
    { dateTime: '2016-03-30 05:58:45', value: '0.0' },
    { dateTime: '2016-03-30 05:58:47', value: '0.0' },
    { dateTime: '2016-03-30 05:58:49', value: '0.0' },
    { dateTime: '2016-03-30 05:58:51', value: '4.0' },
    { dateTime: '2016-03-30 05:58:53', value: '4.0' },
    { dateTime: '2016-03-30 05:58:55', value: '3.0' },
    { dateTime: '2016-03-30 05:58:57', value: '3.0' },
    { dateTime: '2016-03-30 05:58:59', value: '3.0' },
    { dateTime: '2016-03-30 05:59:01', value: '3.0' },
    { dateTime: '2016-03-30 05:59:03', value: '3.0' },
    { dateTime: '2016-03-30 05:59:05', value: '0.0' },
    { dateTime: '2016-03-30 05:59:07', value: '0.0' },
    { dateTime: '2016-03-30 05:59:09', value: '0.0' },
    { dateTime: '2016-03-30 05:59:11', value: '15.0' },
    { dateTime: '2016-03-30 05:59:13', value: '15.0' },
    { dateTime: '2016-03-30 05:59:15', value: '5.0' },
    { dateTime: '2016-03-30 05:59:17', value: '5.0' },
    { dateTime: '2016-03-30 05:59:19', value: '5.0' },
    { dateTime: '2016-03-30 05:59:21', value: '6.0' },
    { dateTime: '2016-03-30 05:59:23', value: '6.0' },
    { dateTime: '2016-03-30 05:59:25', value: '3.0' },
    { dateTime: '2016-03-30 05:59:27', value: '3.0' },
    { dateTime: '2016-03-30 05:59:29', value: '3.0' },
    { dateTime: '2016-03-30 05:59:31', value: '11.0' },
    { dateTime: '2016-03-30 05:59:33', value: '11.0' },
    { dateTime: '2016-03-30 05:59:35', value: '12.0' },
    { dateTime: '2016-03-30 05:59:37', value: '12.0' },
    { dateTime: '2016-03-30 05:59:39', value: '12.0' },
    { dateTime: '2016-03-30 05:59:41', value: '5.0' },
    { dateTime: '2016-03-30 05:59:43', value: '5.0' },
    { dateTime: '2016-03-30 05:59:45', value: '3.0' },
    { dateTime: '2016-03-30 05:59:47', value: '3.0' },
    { dateTime: '2016-03-30 05:59:49', value: '3.0' },
    { dateTime: '2016-03-30 05:59:51', value: '5.0' },
    { dateTime: '2016-03-30 05:59:53', value: '5.0' },
    { dateTime: '2016-03-30 05:59:55', value: '4.0' },
    { dateTime: '2016-03-30 05:59:57', value: '4.0' },
    { dateTime: '2016-03-30 05:59:59', value: '4.0' },
    { dateTime: '2016-03-30 06:00:01', value: '4.0' },
    { dateTime: '2016-03-30 06:00:03', value: '4.0' },
    { dateTime: '2016-03-30 06:00:05', value: '4.0' },
    { dateTime: '2016-03-30 06:00:07', value: '4.0' },
    { dateTime: '2016-03-30 06:00:09', value: '4.0' },
    { dateTime: '2016-03-30 06:00:11', value: '2.0' },
    { dateTime: '2016-03-30 06:00:13', value: '2.0' },
    { dateTime: '2016-03-30 06:00:15', value: '15.0' },
    { dateTime: '2016-03-30 06:00:17', value: '15.0' },
    { dateTime: '2016-03-30 06:00:19', value: '15.0' },
    { dateTime: '2016-03-30 06:00:21', value: '5.0' },
    { dateTime: '2016-03-30 06:00:23', value: '5.0' },
    { dateTime: '2016-03-30 06:00:25', value: '7.0' },
    { dateTime: '2016-03-30 06:00:27', value: '7.0' },
    { dateTime: '2016-03-30 06:00:29', value: '7.0' },
    { dateTime: '2016-03-30 06:00:31', value: '1.0' },
    { dateTime: '2016-03-30 06:00:33', value: '1.0' },
    { dateTime: '2016-03-30 06:00:35', value: '24.0' },
    { dateTime: '2016-03-30 06:00:37', value: '24.0' },
    { dateTime: '2016-03-30 06:00:39', value: '24.0' },
    { dateTime: '2016-03-30 06:00:41', value: '1.0' },
    { dateTime: '2016-03-30 06:00:43', value: '1.0' },
    { dateTime: '2016-03-30 06:00:45', value: '6.0' },
    { dateTime: '2016-03-30 06:00:47', value: '6.0' },
    { dateTime: '2016-03-30 06:00:49', value: '6.0' },
    { dateTime: '2016-03-30 06:00:51', value: '3.0' },
    { dateTime: '2016-03-30 06:00:53', value: '3.0' },
    { dateTime: '2016-03-30 06:00:55', value: '5.0' },
    { dateTime: '2016-03-30 06:00:57', value: '5.0' },
    { dateTime: '2016-03-30 06:00:59', value: '5.0' },
    { dateTime: '2016-03-30 06:01:01', value: '79.0' },
    { dateTime: '2016-03-30 06:01:03', value: '79.0' },
    { dateTime: '2016-03-30 06:01:05', value: '3.0' },
    { dateTime: '2016-03-30 06:01:07', value: '3.0' },
    { dateTime: '2016-03-30 06:01:09', value: '3.0' },
    { dateTime: '2016-03-30 06:01:11', value: '41.0' },
    { dateTime: '2016-03-30 06:01:13', value: '41.0' },
    { dateTime: '2016-03-30 06:01:15', value: '2.0' },
    { dateTime: '2016-03-30 06:01:17', value: '2.0' },
    { dateTime: '2016-03-30 06:01:19', value: '2.0' },
    { dateTime: '2016-03-30 06:01:21', value: '100.0' },
    { dateTime: '2016-03-30 06:01:23', value: '100.0' },
    { dateTime: '2016-03-30 06:01:25', value: '4.0' },
    { dateTime: '2016-03-30 06:01:27', value: '4.0' },
    { dateTime: '2016-03-30 06:01:29', value: '4.0' },
    { dateTime: '2016-03-30 06:01:31', value: '2.0' },
    { dateTime: '2016-03-30 06:01:33', value: '2.0' },
    { dateTime: '2016-03-30 06:01:35', value: '5.0' },
    { dateTime: '2016-03-30 06:01:37', value: '5.0' },
    { dateTime: '2016-03-30 06:01:39', value: '5.0' },
    { dateTime: '2016-03-30 06:01:41', value: '3.0' },
    { dateTime: '2016-03-30 06:01:43', value: '3.0' },
    { dateTime: '2016-03-30 06:01:45', value: '1.0' },
    { dateTime: '2016-03-30 06:01:47', value: '1.0' },
    { dateTime: '2016-03-30 06:01:49', value: '1.0' },
    { dateTime: '2016-03-30 06:01:51', value: '5.0' },
    { dateTime: '2016-03-30 06:01:53', value: '5.0' },
    { dateTime: '2016-03-30 06:01:55', value: '7.0' },
    { dateTime: '2016-03-30 06:01:57', value: '7.0' },
    { dateTime: '2016-03-30 06:01:59', value: '7.0' },
    { dateTime: '2016-03-30 06:02:01', value: '7.0' },
    { dateTime: '2016-03-30 06:02:03', value: '7.0' },
    { dateTime: '2016-03-30 06:02:05', value: '3.0' },
    { dateTime: '2016-03-30 06:02:07', value: '3.0' },
    { dateTime: '2016-03-30 06:02:09', value: '3.0' },
    { dateTime: '2016-03-30 06:02:11', value: '4.0' },
    { dateTime: '2016-03-30 06:02:13', value: '4.0' },
    { dateTime: '2016-03-30 06:02:15', value: '23.0' },
    { dateTime: '2016-03-30 06:02:17', value: '23.0' },
    { dateTime: '2016-03-30 06:02:19', value: '23.0' },
    { dateTime: '2016-03-30 06:02:21', value: '3.0' },
    { dateTime: '2016-03-30 06:02:23', value: '3.0' },
    { dateTime: '2016-03-30 06:02:25', value: '12.0' },
    { dateTime: '2016-03-30 06:02:27', value: '12.0' },
    { dateTime: '2016-03-30 06:02:29', value: '12.0' },
    { dateTime: '2016-03-30 06:02:31', value: '7.0' },
    { dateTime: '2016-03-30 06:02:33', value: '7.0' },
    { dateTime: '2016-03-30 06:02:35', value: '5.0' },
    { dateTime: '2016-03-30 06:02:37', value: '5.0' },
    { dateTime: '2016-03-30 06:02:39', value: '5.0' },
    { dateTime: '2016-03-30 06:02:41', value: '12.0' },
    { dateTime: '2016-03-30 06:02:43', value: '12.0' },
    { dateTime: '2016-03-30 06:02:45', value: '0.0' },
    { dateTime: '2016-03-30 06:02:47', value: '0.0' },
    { dateTime: '2016-03-30 06:02:49', value: '0.0' },
    { dateTime: '2016-03-30 06:02:51', value: '2.0' },
    { dateTime: '2016-03-30 06:02:53', value: '2.0' },
    { dateTime: '2016-03-30 06:02:55', value: '3.0' },
    { dateTime: '2016-03-30 06:02:57', value: '3.0' },
    { dateTime: '2016-03-30 06:02:59', value: '3.0' },
    { dateTime: '2016-03-30 06:03:01', value: '14.0' },
    { dateTime: '2016-03-30 06:03:03', value: '14.0' },
    { dateTime: '2016-03-30 06:03:05', value: '1.0' },
    { dateTime: '2016-03-30 06:03:07', value: '1.0' },
    { dateTime: '2016-03-30 06:03:09', value: '1.0' },
    { dateTime: '2016-03-30 06:03:11', value: '27.0' },
    { dateTime: '2016-03-30 06:03:13', value: '27.0' },
    { dateTime: '2016-03-30 06:03:15', value: '2.0' },
    { dateTime: '2016-03-30 06:03:17', value: '2.0' },
    { dateTime: '2016-03-30 06:03:19', value: '2.0' },
    { dateTime: '2016-03-30 06:03:21', value: '6.0' },
    { dateTime: '2016-03-30 06:03:23', value: '6.0' },
    { dateTime: '2016-03-30 06:03:25', value: '4.0' },
    { dateTime: '2016-03-30 06:03:27', value: '4.0' },
    { dateTime: '2016-03-30 06:03:29', value: '4.0' },
    { dateTime: '2016-03-30 06:03:31', value: '10.0' },
    { dateTime: '2016-03-30 06:03:33', value: '10.0' },
    { dateTime: '2016-03-30 06:03:35', value: '28.0' },
    { dateTime: '2016-03-30 06:03:37', value: '28.0' },
    { dateTime: '2016-03-30 06:03:39', value: '28.0' },
    { dateTime: '2016-03-30 06:03:41', value: '3.0' },
    { dateTime: '2016-03-30 06:03:43', value: '3.0' },
    { dateTime: '2016-03-30 06:03:45', value: '6.0' },
    { dateTime: '2016-03-30 06:03:47', value: '6.0' },
    { dateTime: '2016-03-30 06:03:49', value: '6.0' },
    { dateTime: '2016-03-30 06:03:51', value: '36.0' },
    { dateTime: '2016-03-30 06:03:53', value: '36.0' },
    { dateTime: '2016-03-30 06:03:55', value: '4.0' },
    { dateTime: '2016-03-30 06:03:57', value: '4.0' },
    { dateTime: '2016-03-30 06:03:59', value: '4.0' },
    { dateTime: '2016-03-30 06:04:01', value: '11.0' },
    { dateTime: '2016-03-30 06:04:03', value: '11.0' },
    { dateTime: '2016-03-30 06:04:05', value: '2.0' },
    { dateTime: '2016-03-30 06:04:07', value: '2.0' },
    { dateTime: '2016-03-30 06:04:09', value: '2.0' },
    { dateTime: '2016-03-30 06:04:11', value: '5.0' },
    { dateTime: '2016-03-30 06:04:13', value: '5.0' },
    { dateTime: '2016-03-30 06:04:15', value: '4.0' },
    { dateTime: '2016-03-30 06:04:17', value: '4.0' },
    { dateTime: '2016-03-30 06:04:19', value: '4.0' },
    { dateTime: '2016-03-30 06:04:21', value: '4.0' },
    { dateTime: '2016-03-30 06:04:23', value: '4.0' },
    { dateTime: '2016-03-30 06:04:25', value: '5.0' },
    { dateTime: '2016-03-30 06:04:27', value: '5.0' },
    { dateTime: '2016-03-30 06:04:29', value: '5.0' },
    { dateTime: '2016-03-30 06:04:31', value: '8.0' },
    { dateTime: '2016-03-30 06:04:33', value: '8.0' },
    { dateTime: '2016-03-30 06:04:35', value: '8.0' },
    { dateTime: '2016-03-30 06:04:37', value: '8.0' },
    { dateTime: '2016-03-30 06:04:39', value: '8.0' },
    { dateTime: '2016-03-30 06:04:41', value: '14.0' },
    { dateTime: '2016-03-30 06:04:43', value: '14.0' },
    { dateTime: '2016-03-30 06:04:45', value: '2.0' },
    { dateTime: '2016-03-30 06:04:47', value: '2.0' },
    { dateTime: '2016-03-30 06:04:49', value: '2.0' },
    { dateTime: '2016-03-30 06:04:51', value: '4.0' },
    { dateTime: '2016-03-30 06:04:53', value: '4.0' },
    { dateTime: '2016-03-30 06:04:55', value: '5.0' },
    { dateTime: '2016-03-30 06:04:57', value: '5.0' },
    { dateTime: '2016-03-30 06:04:59', value: '5.0' },
    { dateTime: '2016-03-30 06:05:01', value: '6.0' },
    { dateTime: '2016-03-30 06:05:03', value: '6.0' },
    { dateTime: '2016-03-30 06:05:05', value: '5.0' },
    { dateTime: '2016-03-30 06:05:07', value: '5.0' },
    { dateTime: '2016-03-30 06:05:09', value: '5.0' },
    { dateTime: '2016-03-30 06:05:11', value: '9.0' },
    { dateTime: '2016-03-30 06:05:13', value: '9.0' },
    { dateTime: '2016-03-30 06:05:15', value: '2.0' },
    { dateTime: '2016-03-30 06:05:17', value: '2.0' },
    { dateTime: '2016-03-30 06:05:19', value: '2.0' },
    { dateTime: '2016-03-30 06:05:21', value: '8.0' },
    { dateTime: '2016-03-30 06:05:23', value: '8.0' },
    { dateTime: '2016-03-30 06:05:25', value: '100.0' },
    { dateTime: '2016-03-30 06:05:27', value: '100.0' },
    { dateTime: '2016-03-30 06:05:29', value: '100.0' },
    { dateTime: '2016-03-30 06:05:31', value: '100.0' },
    { dateTime: '2016-03-30 06:05:33', value: '100.0' },
    { dateTime: '2016-03-30 06:05:35', value: '2.0' },
    { dateTime: '2016-03-30 06:05:37', value: '2.0' },
    { dateTime: '2016-03-30 06:05:39', value: '2.0' },
    { dateTime: '2016-03-30 06:05:41', value: '14.0' },
    { dateTime: '2016-03-30 06:05:43', value: '14.0' },
    { dateTime: '2016-03-30 06:05:45', value: '1.0' },
    { dateTime: '2016-03-30 06:05:47', value: '1.0' },
    { dateTime: '2016-03-30 06:05:49', value: '1.0' },
    { dateTime: '2016-03-30 06:05:51', value: '2.0' },
    { dateTime: '2016-03-30 06:05:53', value: '2.0' } ]
  </code></pre>
  
  <p>the above value is in variable console.log(points.points[tags[0]])
  when i print console.log(points.points[tags[0]][0]) its giving me data like this  { dateTime: '2016-03-30 06:05:53', value: '2.0' } </p>
  
  <p>but when i try to print the data console.log(points.points[tags[0]][0].dateTime) its giving me an error. Cannot read property 'dateTime' of undefined
  Cannot read property 'value' of undefined
      </p>
  
  <pre><code>var data = []; 
          &lt;%
         for (var i=0; i &lt; tags.length; i++)
         { %&gt;
         var dataSeries = { type: "line" };
          var dataPoints = [];
  
              // var pointdata ="&lt;%= points.points[tags[i]] %&gt;";
  
  
          for (var n=0; n &lt; &lt;%= points.points[tags[i]].length %&gt;; n++)
          {
  
            &lt;%=   console.log(points.points[tags[i]]); %&gt; 
  
             dataPoints.push({
  
                   x: &lt;%= points.points[tags[i]][n].dateTime %&gt;,
                   y: &lt;%= points.points[tags[i]][n].value %&gt;
              });
          }
               dataSeries.dataPoints = dataPoints;
               data.push(dataSeries);               
            &lt;% } %&gt;
  
      &lt;/script&gt;
  </code></pre>