-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update AccidentCountByRoadLight (#1174)
* update AccidentCountByRoadLight as piechart
- Loading branch information
1 parent
8dd3606
commit 7a01b6c
Showing
3 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
20 changes: 16 additions & 4 deletions
20
src/components/molecules/widgets/AccidentCountByRoadLight.tsx
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 |
---|---|---|
@@ -1,12 +1,24 @@ | ||
import React, { FC } from 'react'; | ||
import { IWidgetAccidentCountByRoadLight } from 'models/WidgetData'; | ||
import PieChartView from 'components/molecules/PieChartView'; | ||
|
||
const ROAD_LIGHT = 'road_light'; | ||
const COUNT = 'count'; | ||
const INNER_RADIUS = '40%'; | ||
const OUTER_RADIUS = '70%'; | ||
interface IProps { | ||
data: IWidgetAccidentCountByRoadLight; | ||
segmentText: string; | ||
} | ||
|
||
const AccidentCountByRoadLight: FC<IProps> = () => { | ||
return <div> {} </div>; | ||
const AccidentCountByRoadLight: FC<IProps> = ({ data }) => { | ||
return ( | ||
<PieChartView | ||
data={data.items} | ||
xLabel={ROAD_LIGHT} | ||
yLabel={COUNT} | ||
outerRadius={OUTER_RADIUS} | ||
innerRadius={INNER_RADIUS} | ||
/> | ||
); | ||
}; | ||
export default AccidentCountByRoadLight; | ||
export default AccidentCountByRoadLight; |
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