Created
May 24, 2022 20:41
-
-
Save sourabhbagrecha/52a65d6c9e63bcfa5b5a60a3458a7036 to your computer and use it in GitHub Desktop.
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
import Chart from "react-google-charts"; | |
const ModeAnalytics = ({ data }) => { | |
const chartData = [["Mode", "Amount"]]; | |
data.forEach(({ mode, amount }) => { | |
chartData.push([mode, amount]); | |
}); | |
return <> | |
<h3>Mode Analytics</h3> | |
<Chart | |
chartType="PieChart" | |
data={chartData} | |
width={"100%"} | |
height={"400px"} | |
/> | |
</> | |
} | |
export default ModeAnalytics; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment