Connect line graph prefix and suffix to child single stat
parent
1de16619be
commit
8d095d1bb3
|
@ -84,6 +84,14 @@ class LineGraph extends Component {
|
|||
? SINGLE_STAT_LINE_COLORS
|
||||
: overrideLineColors
|
||||
|
||||
let prefix
|
||||
let suffix
|
||||
|
||||
if (axes) {
|
||||
prefix = axes.y.prefix
|
||||
suffix = axes.y.suffix
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="dygraph graph--hasYLabel" style={{height: '100%'}}>
|
||||
{isRefreshing ? <GraphLoadingDots /> : null}
|
||||
|
@ -108,6 +116,8 @@ class LineGraph extends Component {
|
|||
/>
|
||||
{showSingleStat
|
||||
? <SingleStat
|
||||
prefix={prefix}
|
||||
suffix={suffix}
|
||||
data={data}
|
||||
lineGraph={true}
|
||||
colors={colors}
|
||||
|
|
|
@ -17,6 +17,7 @@ class SingleStat extends PureComponent {
|
|||
cellHeight,
|
||||
isFetchingInitially,
|
||||
colors,
|
||||
prefix,
|
||||
suffix,
|
||||
lineGraph,
|
||||
} = this.props
|
||||
|
@ -74,6 +75,7 @@ class SingleStat extends PureComponent {
|
|||
'single-stat--small': cellHeight === SMALL_CELL_HEIGHT,
|
||||
})}
|
||||
>
|
||||
{prefix}
|
||||
{roundedValue}
|
||||
{suffix}
|
||||
{lineGraph && <div className="single-stat--shadow" />}
|
||||
|
@ -98,6 +100,7 @@ SingleStat.propTypes = {
|
|||
value: string.isRequired,
|
||||
}).isRequired
|
||||
),
|
||||
prefix: string,
|
||||
suffix: string,
|
||||
lineGraph: bool,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue