Passed
Push — master ( 0b01ae...6aca38 )
by Guangyu
08:43 queued 11s
created

src/components/MyEMS/Equipment/EquipmentOutput.js   A

Complexity

Total Complexity 24
Complexity/F 0

Size

Lines of Code 562
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 24
eloc 492
mnd 24
bc 24
fnc 0
dl 0
loc 562
rs 10
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
1
import React, { Fragment, useEffect, useState } from 'react';
2
import {
3
  Breadcrumb,
4
  BreadcrumbItem,
5
  Row,
6
  Col,
7
  Card,
8
  CardBody,
9
  Button,
10
  ButtonGroup,
11
  Form,
12
  FormGroup,
13
  Input,
14
  Label,
15
  CustomInput
16
} from 'reactstrap';
17
import CountUp from 'react-countup';
18
import Datetime from 'react-datetime';
19
import moment from 'moment';
20
import loadable from '@loadable/component';
21
import Cascader from 'rc-cascader';
22
import CardSummary from '../common/CardSummary';
23
import LineChart from '../common/LineChart';
24
import { getCookieValue, createCookie } from '../../../helpers/utils';
25
import withRedirect from '../../../hoc/withRedirect';
26
import { withTranslation } from 'react-i18next';
27
import { toast } from 'react-toastify';
28
import { APIBaseURL } from '../../../config';
29
import { periodTypeOptions } from '../common/PeriodTypeOptions';
30
import { comparisonTypeOptions } from '../common/ComparisonTypeOptions';
31
32
33
const DetailedDataTable = loadable(() => import('../common/DetailedDataTable'));
34
35
const EquipmentOutput = ({ setRedirect, setRedirectUrl, t }) => {
36
  let current_moment = moment();
37
  useEffect(() => {
38
    let is_logged_in = getCookieValue('is_logged_in');
39
    let user_name = getCookieValue('user_name');
40
    let user_display_name = getCookieValue('user_display_name');
41
    let user_uuid = getCookieValue('user_uuid');
42
    let token = getCookieValue('token');
43
    if (is_logged_in === null || !is_logged_in) {
44
      setRedirectUrl(`/authentication/basic/login`);
45
      setRedirect(true);
46
    } else {
47
      //update expires time of cookies
48
      createCookie('is_logged_in', true, 1000 * 60 * 60 * 8);
49
      createCookie('user_name', user_name, 1000 * 60 * 60 * 8);
50
      createCookie('user_display_name', user_display_name, 1000 * 60 * 60 * 8);
51
      createCookie('user_uuid', user_uuid, 1000 * 60 * 60 * 8);
52
      createCookie('token', token, 1000 * 60 * 60 * 8);
53
    }
54
  });
55
  // State
56
  // Query Parameters
57
  const [selectedSpaceName, setSelectedSpaceName] = useState(undefined);
58
  const [selectedSpaceID, setSelectedSpaceID] = useState(undefined);
59
  const [equipmentList, setEquipmentList] = useState([]);
60
  const [selectedEquipment, setSelectedEquipment] = useState(undefined);
61
  const [comparisonType, setComparisonType] = useState('month-on-month');
62
  const [periodType, setPeriodType] = useState('daily');
63
  const [basePeriodBeginsDatetime, setBasePeriodBeginsDatetime] = useState(current_moment.clone().subtract(1, 'months').startOf('month'));
64
  const [basePeriodEndsDatetime, setBasePeriodEndsDatetime] = useState(current_moment.clone().subtract(1, 'months'));
65
  const [basePeriodBeginsDatetimeDisabled, setBasePeriodBeginsDatetimeDisabled] = useState(true);
66
  const [basePeriodEndsDatetimeDisabled, setBasePeriodEndsDatetimeDisabled] = useState(true);
67
  const [reportingPeriodBeginsDatetime, setReportingPeriodBeginsDatetime] = useState(current_moment.clone().startOf('month'));
68
  const [reportingPeriodEndsDatetime, setReportingPeriodEndsDatetime] = useState(current_moment);
69
  const [cascaderOptions, setCascaderOptions] = useState(undefined);
70
  const [isDisabled, setIsDisabled] = useState(true);
71
  //Results
72
  const [cardSummaryList, setCardSummaryList] = useState([]);
73
  const [equipmentLineChartLabels, setEquipmentLineChartLabels] = useState([]);
74
  const [equipmentLineChartData, setEquipmentLineChartData] = useState({});
75
  const [equipmentLineChartOptions, setEquipmentLineChartOptions] = useState([]);
76
77
  const [parameterLineChartLabels, setParameterLineChartLabels] = useState([]);
78
  const [parameterLineChartData, setParameterLineChartData] = useState({});
79
  const [parameterLineChartOptions, setParameterLineChartOptions] = useState([]);
80
81
  const [detailedDataTableData, setDetailedDataTableData] = useState([]);
82
  const [detailedDataTableColumns, setDetailedDataTableColumns] = useState([{dataField: 'startdatetime', text: t('Datetime'), sort: true}]);
83
84
  useEffect(() => {
85
    let isResponseOK = false;
86
    fetch(APIBaseURL + '/spaces/tree', {
87
      method: 'GET',
88
      headers: {
89
        "Content-type": "application/json",
90
        "User-UUID": getCookieValue('user_uuid'),
91
        "Token": getCookieValue('token')
92
      },
93
      body: null,
94
95
    }).then(response => {
96
      console.log(response);
97
      if (response.ok) {
98
        isResponseOK = true;
99
      }
100
      return response.json();
101
    }).then(json => {
102
      console.log(json);
103
      if (isResponseOK) {
104
        // rename keys 
105
        json = JSON.parse(JSON.stringify([json]).split('"id":').join('"value":').split('"name":').join('"label":'));
106
        setCascaderOptions(json);
107
        setSelectedSpaceName([json[0]].map(o => o.label));
108
        setSelectedSpaceID([json[0]].map(o => o.value));
109
        // get Equipments by root Space ID
110
        let isResponseOK = false;
111
        fetch(APIBaseURL + '/spaces/' + [json[0]].map(o => o.value) + '/equipments', {
112
          method: 'GET',
113
          headers: {
114
            "Content-type": "application/json",
115
            "User-UUID": getCookieValue('user_uuid'),
116
            "Token": getCookieValue('token')
117
          },
118
          body: null,
119
120
        }).then(response => {
121
          if (response.ok) {
122
            isResponseOK = true;
123
          }
124
          return response.json();
125
        }).then(json => {
126
          if (isResponseOK) {
127
            json = JSON.parse(JSON.stringify([json]).split('"id":').join('"value":').split('"name":').join('"label":'));
128
            console.log(json);
129
            setEquipmentList(json[0]);
130
            if (json[0].length > 0) {
131
              setSelectedEquipment(json[0][0].value);
132
              setIsDisabled(false);
133
            } else {
134
              setSelectedEquipment(undefined);
135
              setIsDisabled(true);
136
            }
137
          } else {
138
            toast.error(json.description)
139
          }
140
        }).catch(err => {
141
          console.log(err);
142
        });
143
        // end of get Equipments by root Space ID
144
      } else {
145
        toast.error(json.description);
146
      }
147
    }).catch(err => {
148
      console.log(err);
149
    });
150
151
  }, []);
152
153
  const labelClasses = 'ls text-uppercase text-600 font-weight-semi-bold mb-0';
154
155
  let onSpaceCascaderChange = (value, selectedOptions) => {
156
    setSelectedSpaceName(selectedOptions.map(o => o.label).join('/'));
157
    setSelectedSpaceID(value[value.length - 1]);
158
159
    let isResponseOK = false;
160
    fetch(APIBaseURL + '/spaces/' + value[value.length - 1] + '/equipments', {
161
      method: 'GET',
162
      headers: {
163
        "Content-type": "application/json",
164
        "User-UUID": getCookieValue('user_uuid'),
165
        "Token": getCookieValue('token')
166
      },
167
      body: null,
168
169
    }).then(response => {
170
      if (response.ok) {
171
        isResponseOK = true;
172
      }
173
      return response.json();
174
    }).then(json => {
175
      if (isResponseOK) {
176
        json = JSON.parse(JSON.stringify([json]).split('"id":').join('"value":').split('"name":').join('"label":'));
177
        console.log(json)
178
        setEquipmentList(json[0]);
179
        if (json[0].length > 0) {
180
          setSelectedEquipment(json[0][0].value);
181
          setIsDisabled(false);
182
        } else {
183
          setSelectedEquipment(undefined);
184
          setIsDisabled(true);
185
        }
186
      } else {
187
        toast.error(json.description)
188
      }
189
    }).catch(err => {
190
      console.log(err);
191
    });
192
  }
193
194
195
  let onComparisonTypeChange = ({ target }) => {
196
    console.log(target.value);
197
    setComparisonType(target.value);
198
    if (target.value === 'year-over-year') {
199
      setBasePeriodBeginsDatetimeDisabled(true);
200
      setBasePeriodEndsDatetimeDisabled(true);
201
      setBasePeriodBeginsDatetime(moment(reportingPeriodBeginsDatetime).subtract(1, 'years'));
202
      setBasePeriodEndsDatetime(moment(reportingPeriodEndsDatetime).subtract(1, 'years'));
203
    } else if (target.value === 'month-on-month') {
204
      setBasePeriodBeginsDatetimeDisabled(true);
205
      setBasePeriodEndsDatetimeDisabled(true);
206
      setBasePeriodBeginsDatetime(moment(reportingPeriodBeginsDatetime).subtract(1, 'months'));
207
      setBasePeriodEndsDatetime(moment(reportingPeriodEndsDatetime).subtract(1, 'months'));
208
    } else if (target.value === 'free-comparison') {
209
      setBasePeriodBeginsDatetimeDisabled(false);
210
      setBasePeriodEndsDatetimeDisabled(false);
211
    } else if (target.value === 'none-comparison') {
212
      setBasePeriodBeginsDatetime(undefined);
213
      setBasePeriodEndsDatetime(undefined);
214
      setBasePeriodBeginsDatetimeDisabled(true);
215
      setBasePeriodEndsDatetimeDisabled(true);
216
    }
217
  }
218
219
  let onBasePeriodBeginsDatetimeChange = (newDateTime) => {
220
    setBasePeriodBeginsDatetime(newDateTime);
221
  }
222
223
  let onBasePeriodEndsDatetimeChange = (newDateTime) => {
224
    setBasePeriodEndsDatetime(newDateTime);
225
  }
226
227
  let onReportingPeriodBeginsDatetimeChange = (newDateTime) => {
228
    setReportingPeriodBeginsDatetime(newDateTime);
229
    if (comparisonType === 'year-over-year') {
230
      setBasePeriodBeginsDatetime(newDateTime.clone().subtract(1, 'years'));
231
    } else if (comparisonType === 'month-on-month') {
232
      setBasePeriodBeginsDatetime(newDateTime.clone().subtract(1, 'months'));
233
    }
234
  }
235
236
  let onReportingPeriodEndsDatetimeChange = (newDateTime) => {
237
    setReportingPeriodEndsDatetime(newDateTime);
238
    if (comparisonType === 'year-over-year') {
239
      setBasePeriodEndsDatetime(newDateTime.clone().subtract(1, 'years'));
240
    } else if (comparisonType === 'month-on-month') {
241
      setBasePeriodEndsDatetime(newDateTime.clone().subtract(1, 'months'));
242
    }
243
  }
244
245
  var getValidBasePeriodBeginsDatetimes = function (currentDate) {
246
    return currentDate.isBefore(moment(basePeriodEndsDatetime, 'MM/DD/YYYY, hh:mm:ss a'));
247
  }
248
249
  var getValidBasePeriodEndsDatetimes = function (currentDate) {
250
    return currentDate.isAfter(moment(basePeriodBeginsDatetime, 'MM/DD/YYYY, hh:mm:ss a'));
251
  }
252
253
  var getValidReportingPeriodBeginsDatetimes = function (currentDate) {
254
    return currentDate.isBefore(moment(reportingPeriodEndsDatetime, 'MM/DD/YYYY, hh:mm:ss a'));
255
  }
256
257
  var getValidReportingPeriodEndsDatetimes = function (currentDate) {
258
    return currentDate.isAfter(moment(reportingPeriodBeginsDatetime, 'MM/DD/YYYY, hh:mm:ss a'));
259
  }
260
261
  // Handler
262
  const handleSubmit = e => {
263
    e.preventDefault();
264
    console.log('handleSubmit');
265
    console.log(selectedSpaceID);
266
    console.log(selectedEquipment);
267
    console.log(comparisonType);
268
    console.log(periodType);
269
    console.log(basePeriodBeginsDatetime != null ? basePeriodBeginsDatetime.format('YYYY-MM-DDTHH:mm:ss') : undefined);
270
    console.log(basePeriodEndsDatetime != null ? basePeriodEndsDatetime.format('YYYY-MM-DDTHH:mm:ss') : undefined);
271
    console.log(reportingPeriodBeginsDatetime.format('YYYY-MM-DDTHH:mm:ss'));
272
    console.log(reportingPeriodEndsDatetime.format('YYYY-MM-DDTHH:mm:ss'));
273
274
    // Reinitialize tables
275
    setDetailedDataTableData([]);
276
    
277
    let isResponseOK = false;
278
    fetch(APIBaseURL + '/reports/equipmentoutput?' +
279
      'equipmentid=' + selectedEquipment +
280
      '&periodtype=' + periodType +
281
      '&baseperiodstartdatetime=' + (basePeriodBeginsDatetime != null ? basePeriodBeginsDatetime.format('YYYY-MM-DDTHH:mm:ss') : '') +
282
      '&baseperiodenddatetime=' + (basePeriodEndsDatetime != null ? basePeriodEndsDatetime.format('YYYY-MM-DDTHH:mm:ss') : '') +
283
      '&reportingperiodstartdatetime=' + reportingPeriodBeginsDatetime.format('YYYY-MM-DDTHH:mm:ss') +
284
      '&reportingperiodenddatetime=' + reportingPeriodEndsDatetime.format('YYYY-MM-DDTHH:mm:ss'), {
285
      method: 'GET',
286
      headers: {
287
        "Content-type": "application/json",
288
        "User-UUID": getCookieValue('user_uuid'),
289
        "Token": getCookieValue('token')
290
      },
291
      body: null,
292
293
    }).then(response => {
294
      if (response.ok) {
295
        isResponseOK = true;
296
      }
297
      return response.json();
298
    }).then(json => {
299
      if (isResponseOK) {
300
        console.log(json)
301
        let cardSummaryArray = []
302
        json['reporting_period']['names'].forEach((currentValue, index) => {
303
          let cardSummaryItem = {}
304
          cardSummaryItem['name'] = json['reporting_period']['names'][index];
305
          cardSummaryItem['unit'] = json['reporting_period']['units'][index];
306
          cardSummaryItem['subtotal'] = json['reporting_period']['subtotals'][index];
307
          cardSummaryItem['increment_rate'] = parseFloat(json['reporting_period']['increment_rates'][index] * 100).toFixed(2) + "%";
308
          cardSummaryArray.push(cardSummaryItem);
309
        });
310
        setCardSummaryList(cardSummaryArray);
311
312
        let timestamps = {}
313
        json['reporting_period']['timestamps'].forEach((currentValue, index) => {
314
          timestamps['a' + index] = currentValue;
315
        });
316
        setEquipmentLineChartLabels(timestamps);
317
        
318
        let values = {}
319
        json['reporting_period']['values'].forEach((currentValue, index) => {
320
          values['a' + index] = currentValue;
321
        });
322
        setEquipmentLineChartData(values);
323
        
324
        let names = Array();
325
        json['reporting_period']['names'].forEach((currentValue, index) => {
326
          let unit = json['reporting_period']['units'][index];
327
          names.push({ 'value': 'a' + index, 'label': currentValue + ' (' + unit + ')'});
328
        });
329
        setEquipmentLineChartOptions(names);
330
       
331
        timestamps = {}
332
        json['parameters']['timestamps'].forEach((currentValue, index) => {
333
          timestamps['a' + index] = currentValue;
334
        });
335
        setParameterLineChartLabels(timestamps);
336
337
        values = {}
338
        json['parameters']['values'].forEach((currentValue, index) => {
339
          values['a' + index] = currentValue;
340
        });
341
        setParameterLineChartData(values);
342
      
343
        names = Array();
344
        json['parameters']['names'].forEach((currentValue, index) => {
345
          if (currentValue.startsWith('TARIFF-')) {
346
            currentValue = t('Tariff') + currentValue.replace('TARIFF-', '-');
347
          }
348
          
349
          names.push({ 'value': 'a' + index, 'label': currentValue });
350
        });
351
        setParameterLineChartOptions(names);
352
      
353
        let detailed_value_list = [];
354
        json['reporting_period']['timestamps'][0].forEach((currentTimestamp, timestampIndex) => {
355
          let detailed_value = {};
356
          detailed_value['id'] = timestampIndex;
357
          detailed_value['startdatetime'] = currentTimestamp;
358
          json['reporting_period']['values'].forEach((currentValue, energyCategoryIndex) => {
359
            detailed_value['a' + energyCategoryIndex] = json['reporting_period']['values'][energyCategoryIndex][timestampIndex].toFixed(2);
360
          });
361
          detailed_value_list.push(detailed_value);
362
        });
363
364
        let detailed_value = {};
365
        detailed_value['id'] = detailed_value_list.length;
366
        detailed_value['startdatetime'] = t('Subtotal');
367
        json['reporting_period']['subtotals'].forEach((currentValue, index) => {
368
            detailed_value['a' + index] = currentValue.toFixed(2);
369
          });
370
        detailed_value_list.push(detailed_value);
371
        setDetailedDataTableData(detailed_value_list);
372
        
373
        let detailed_column_list = [];
374
        detailed_column_list.push({
375
          dataField: 'startdatetime',
376
          text: t('Datetime'),
377
          sort: true
378
        })
379
        json['reporting_period']['names'].forEach((currentValue, index) => {
380
          let unit = json['reporting_period']['units'][index];
381
          detailed_column_list.push({
382
            dataField: 'a' + index,
383
            text: currentValue + ' (' + unit + ')',
384
            sort: true
385
          })
386
        });
387
        setDetailedDataTableColumns(detailed_column_list);       
388
389
      } else {
390
        toast.error(json.description)
391
      }
392
    }).catch(err => {
393
      console.log(err);
394
    });
395
  };
396
397
  return (
398
    <Fragment>
399
      <div>
400
        <Breadcrumb>
401
          <BreadcrumbItem>{t('Equipment Data')}</BreadcrumbItem><BreadcrumbItem active>{t('Output')}</BreadcrumbItem>
402
        </Breadcrumb>
403
      </div>
404
      <Card className="bg-light mb-3">
405
        <CardBody className="p-3">
406
          <Form onSubmit={handleSubmit}>
407
            <Row form>
408
              <Col xs="auto">
409
                <FormGroup className="form-group">
410
                  <Label className={labelClasses} for="space">
411
                    {t('Space')}
412
                  </Label>
413
                  <br />
414
                  <Cascader options={cascaderOptions}
415
                    onChange={onSpaceCascaderChange}
416
                    changeOnSelect
417
                    expandTrigger="hover">
418
                    <Input value={selectedSpaceName || ''} readOnly />
419
                  </Cascader>
420
                </FormGroup>
421
              </Col>
422
              <Col xs="auto">
423
                <FormGroup>
424
                  <Label className={labelClasses} for="equipmentSelect">
425
                    {t('Equipment')}
426
                  </Label>
427
                  <CustomInput type="select" id="equipmentSelect" name="equipmentSelect" onChange={({ target }) => setSelectedEquipment(target.value)}
428
                  >
429
                    {equipmentList.map((equipment, index) => (
430
                      <option value={equipment.value} key={equipment.value}>
431
                        {equipment.label}
432
                      </option>
433
                    ))}
434
                  </CustomInput>
435
                </FormGroup>
436
              </Col>
437
              <Col xs="auto">
438
                <FormGroup>
439
                  <Label className={labelClasses} for="comparisonType">
440
                    {t('Comparison Types')}
441
                  </Label>
442
                  <CustomInput type="select" id="comparisonType" name="comparisonType"
443
                    defaultValue="month-on-month"
444
                    onChange={onComparisonTypeChange}
445
                  >
446
                    {comparisonTypeOptions.map((comparisonType, index) => (
447
                      <option value={comparisonType.value} key={comparisonType.value} >
448
                        {t(comparisonType.label)}
449
                      </option>
450
                    ))}
451
                  </CustomInput>
452
                </FormGroup>
453
              </Col>
454
              <Col xs="auto">
455
                <FormGroup>
456
                  <Label className={labelClasses} for="periodType">
457
                    {t('Period Types')}
458
                  </Label>
459
                  <CustomInput type="select" id="periodType" name="periodType" defaultValue="daily" onChange={({ target }) => setPeriodType(target.value)}
460
                  >
461
                    {periodTypeOptions.map((periodType, index) => (
462
                      <option value={periodType.value} key={periodType.value} >
463
                        {t(periodType.label)}
464
                      </option>
465
                    ))}
466
                  </CustomInput>
467
                </FormGroup>
468
              </Col>
469
              <Col xs="auto">
470
                <FormGroup className="form-group">
471
                  <Label className={labelClasses} for="basePeriodBeginsDatetime">
472
                    {t('Base Period Begins')}{t('(Optional)')}
473
                  </Label>
474
                  <Datetime id='basePeriodBeginsDatetime'
475
                    value={basePeriodBeginsDatetime}
476
                    inputProps={{ disabled: basePeriodBeginsDatetimeDisabled }}
477
                    onChange={onBasePeriodBeginsDatetimeChange}
478
                    isValidDate={getValidBasePeriodBeginsDatetimes}
479
                    closeOnSelect={true} />
480
                </FormGroup>
481
              </Col>
482
              <Col xs="auto">
483
                <FormGroup className="form-group">
484
                  <Label className={labelClasses} for="basePeriodEndsDatetime">
485
                    {t('Base Period Ends')}{t('(Optional)')}
486
                  </Label>
487
                  <Datetime id='basePeriodEndsDatetime'
488
                    value={basePeriodEndsDatetime}
489
                    inputProps={{ disabled: basePeriodEndsDatetimeDisabled }}
490
                    onChange={onBasePeriodEndsDatetimeChange}
491
                    isValidDate={getValidBasePeriodEndsDatetimes}
492
                    closeOnSelect={true} />
493
                </FormGroup>
494
              </Col>
495
              <Col xs="auto">
496
                <FormGroup className="form-group">
497
                  <Label className={labelClasses} for="reportingPeriodBeginsDatetime">
498
                    {t('Reporting Period Begins')}
499
                  </Label>
500
                  <Datetime id='reportingPeriodBeginsDatetime'
501
                    value={reportingPeriodBeginsDatetime}
502
                    onChange={onReportingPeriodBeginsDatetimeChange}
503
                    isValidDate={getValidReportingPeriodBeginsDatetimes}
504
                    closeOnSelect={true} />
505
                </FormGroup>
506
              </Col>
507
              <Col xs="auto">
508
                <FormGroup className="form-group">
509
                  <Label className={labelClasses} for="reportingPeriodEndsDatetime">
510
                    {t('Reporting Period Ends')}
511
                  </Label>
512
                  <Datetime id='reportingPeriodEndsDatetime'
513
                    value={reportingPeriodEndsDatetime}
514
                    onChange={onReportingPeriodEndsDatetimeChange}
515
                    isValidDate={getValidReportingPeriodEndsDatetimes}
516
                    closeOnSelect={true} />
517
                </FormGroup>
518
              </Col>
519
              <Col xs="auto">
520
                <FormGroup>
521
                  <br></br>
522
                  <ButtonGroup id="submit">
523
                    <Button color="success" disabled={isDisabled} >{t('Submit')}</Button>
524
                  </ButtonGroup>
525
                </FormGroup>
526
              </Col>
527
            </Row>
528
          </Form>
529
        </CardBody>
530
      </Card>
531
      <div className="card-deck">
532
        {cardSummaryList.map(cardSummaryItem => (
533
          <CardSummary key={cardSummaryItem['name']}
534
            rate={cardSummaryItem['increment_rate']}
535
            title={t('Reporting Period Output CATEGORY UNIT', { 'CATEGORY': cardSummaryItem['name'], 'UNIT': '(' + cardSummaryItem['unit'] + ')' })}
536
            color="success" >
537
            {cardSummaryItem['subtotal'] && <CountUp end={cardSummaryItem['subtotal']} duration={2} prefix="" separator="," decimal="." decimals={2} />}
538
          </CardSummary>
539
        ))}
540
      </div>
541
      <LineChart reportingTitle={t('Reporting Period Output CATEGORY VALUE UNIT', { 'CATEGORY': null, 'VALUE': null, 'UNIT': null })}
542
        baseTitle=''
543
        labels={equipmentLineChartLabels}
544
        data={equipmentLineChartData}
545
        options={equipmentLineChartOptions}>
546
      </LineChart>
547
      <LineChart reportingTitle={t('Related Parameters')}
548
        baseTitle=''
549
        labels={parameterLineChartLabels}
550
        data={parameterLineChartData}
551
        options={parameterLineChartOptions}>
552
      </LineChart>
553
      <br />
554
      <DetailedDataTable data={detailedDataTableData} title={t('Detailed Data')} columns={detailedDataTableColumns} pagesize={50} >
555
      </DetailedDataTable>
556
557
    </Fragment>
558
  );
559
};
560
561
export default withTranslation()(withRedirect(EquipmentOutput));
562