forked from ddrilling/asb_cloud_front
Отображение графиков мониторинга исправлено
This commit is contained in:
parent
4937dddf87
commit
de72f13bac
@ -5,17 +5,13 @@ import {ChartTimeOnlineFooter} from './ChartTimeOnlineFooter';
|
|||||||
const stroke = (sz='1px', c='white') => ({ textShadow: `-${sz} -${sz} 0 ${c}, ${sz} -${sz} 0 ${c}, -${sz} ${sz} 0 ${c}, ${sz} ${sz} 0 ${c}` })
|
const stroke = (sz='1px', c='white') => ({ textShadow: `-${sz} -${sz} 0 ${c}, ${sz} -${sz} 0 ${c}, -${sz} ${sz} 0 ${c}, ${sz} ${sz} 0 ${c}` })
|
||||||
|
|
||||||
export const Column = ({lineGroup, data, interval, showBorder, style, headerHeight}) => {
|
export const Column = ({lineGroup, data, interval, showBorder, style, headerHeight}) => {
|
||||||
let dataLast = null
|
let dataLast = data?.length > 0 ? data[data.length - 1] : null
|
||||||
let pv = null
|
let pv = lineGroup.filter(line => line.showGraph).map(line => ({
|
||||||
if (data?.length > 0) {
|
color: line.color,
|
||||||
dataLast = data[data.length - 1];
|
label: line.label,
|
||||||
pv = lineGroup.filter(line => line.showGraph).map(line => ({
|
unit: line.units,
|
||||||
color: line.color,
|
value: dataLast?.[line.xAccessorName]
|
||||||
label: line.label,
|
}))
|
||||||
unit: line.units,
|
|
||||||
value: dataLast[line.xAccessorName]
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={style}>
|
<div style={style}>
|
||||||
@ -27,7 +23,7 @@ export const Column = ({lineGroup, data, interval, showBorder, style, headerHeig
|
|||||||
<div style={{position: 'relative'}}>
|
<div style={{position: 'relative'}}>
|
||||||
<Grid className={'display_chart_values'}>
|
<Grid className={'display_chart_values'}>
|
||||||
{pv?.map((v, idx) => (
|
{pv?.map((v, idx) => (
|
||||||
<GridItem key={idx} col={1} row={idx} style={{...stroke(), color: v.color, padding: '0 4px'}}>{v.value.toFixed(2)} {v.unit}</GridItem>
|
<GridItem key={idx} col={1} row={idx} style={{...stroke(), color: v.color, padding: '0 4px'}}>{v.value?.toFixed(2) ?? '--'} {v.unit}</GridItem>
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
<ChartTimeOnline
|
<ChartTimeOnline
|
||||||
|
@ -43,7 +43,7 @@ const blockHeightGroup = [
|
|||||||
dash
|
dash
|
||||||
}, {
|
}, {
|
||||||
label: 'Расход',
|
label: 'Расход',
|
||||||
units: 'м³/ч',
|
units: 'л/c',
|
||||||
xAccessorName: 'flow',
|
xAccessorName: 'flow',
|
||||||
yAccessorName: 'date',
|
yAccessorName: 'date',
|
||||||
color: '#077',
|
color: '#077',
|
||||||
|
Loading…
Reference in New Issue
Block a user