-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved History charts to AreaChart component, change color of donuts a…
…nd added ids
- Loading branch information
Showing
7 changed files
with
116 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/components/VmDetails/cards/UtilizationCard/UtilizationCharts/AreaChart.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import { | ||
ChartGroup, | ||
ChartVoronoiContainer, | ||
ChartTooltip, | ||
ChartArea, | ||
} from '@patternfly/react-charts' | ||
|
||
const AreaChart = ({ data, labels, id }) => { | ||
return ( | ||
<div id={id}> | ||
<ChartGroup | ||
height={150} | ||
width={450} | ||
containerComponent={ | ||
<ChartVoronoiContainer | ||
labels={labels} | ||
labelComponent={<ChartTooltip style={{ fontSize: 16 }} />} | ||
/> | ||
} | ||
> | ||
<ChartArea | ||
style={{ data: { fill: 'rgb(0, 136, 206)', strokeWidth: 5 } }} | ||
data={data} | ||
/> | ||
</ChartGroup> | ||
</div> | ||
) | ||
} | ||
|
||
const datumPropType = PropTypes.shape({ | ||
x: PropTypes.number, | ||
y: PropTypes.number, | ||
name: PropTypes.string, | ||
}) | ||
|
||
AreaChart.propTypes = { | ||
id: PropTypes.string, | ||
data: PropTypes.arrayOf(datumPropType).isRequired, | ||
labels: PropTypes.func.isRequired, | ||
} | ||
|
||
export default AreaChart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters