Created
May 24, 2022 20:42
-
-
Save sourabhbagrecha/227a5d2f25e3be943dd01b1f6e0df1fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 CategoryAnalytics = ({ data }) => { | |
| const chartData = [["Category", "Amount"]]; | |
| data.forEach(({ category, amount }) => { | |
| chartData.push([category, amount]); | |
| }); | |
| return <> | |
| <h3>Category Analytics</h3> | |
| <Chart | |
| chartType="PieChart" | |
| data={chartData} | |
| width={"100%"} | |
| height={"400px"} | |
| /> | |
| </> | |
| } | |
| export default CategoryAnalytics; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment